Using custom short codes – WP Content Crawler
Articles,  Blog

Using custom short codes – WP Content Crawler


Hi! Welcome to another WordPress Content Crawler tutorial. In this tutorial, we will learn how to use custom short code selectors to place any data anywhere in the post template. First of all, let’s create a site, fill its name, site URL and test post URL. Then, let’s go to the site and show developer tools. Let’s start by adding a CSS selector for the title of the post. Now, let’s add a short code selector for the telephone number shown on the target page. We can get any attribute of the element specified by the selector. If we want to get the text of the element, we can just write “text”. Let’s test it to check if it works properly. Great! We can see the phone number. Now let’s create a short code selector for the email. Let’s check “single” checkbox to make sure that the first found result will be used. Otherwise, if there are more than one result, the results will be merged. Let’s define the short code names. We can now use the short codes any where in the post template. Let’s place the short codes in the template. Now, let’s go to the tester to make sure it works properly. Awesome! We can see the phone number and the email. We can also add things before and after the short codes. Let’s change the styling of the short codes and test it. Awesome! Finally, let’s save a post to make sure it works. Thanks for watching!

Leave a Reply

Your email address will not be published. Required fields are marked *