


Lines beginning with two slashes (“//”) are comments and are not executed as code. ")" Īdd_shortcode('my-blogs', 'sitemap_blog') How does it work? Create shortcode to list my blog posts Perhaps take a backup copy of the original functions.php file first – better safe than sorry. Take care not to change any of the existing code as this will almost certainly break your site. With your child theme’s functions.php file open, add the following php code above the closing “?>”. To set up a child theme properly and instruct your WordPress installation to use it, follow Smashing Magazine’s excellent tutorial here If not then you’ll need to create this, as you really shouldn’t be editing the theme’s files (this is known as “hacking the theme” or “hacking core code” and it’s bad practice). In the same folder you should also have a child version of that theme, eg mytheme-child.

Look in your wp-content/themes folder and you should see your main theme (and possibly others, like the WordPress default twentyseventeen etc), eg mytheme. Important! If you’re using a purchased or downloaded theme, then you should have a child theme set up too. You’ll find this in the root of your theme folder. Open your functions.php file in a plain text editor like Notepad or TextWrangler. We’ve used this here on our website to add a listing of our blog posts to our site map page, alongside the regular list of pages.
TEXTWRANGLER THEME HOW TO
In the quick tutorial that follows, we walk through how to create a shortcode that writes out a bullet point list of all your blog posts. Shortcodes are so much more powerful though – your imagination and coding skills really are your limit.
TEXTWRANGLER THEME FULL
This is useful since it saves you writing out the full phone number everytime, formatting it and hyperlinking it. What is a shortcode?Ī shortcode is a shortcut tag that you can enter into a WordPress page to run a certain piece of pre-defined functionality, for example entering the shortcode “” into your blog post might print out your telephone number formatted to a certain style and as a live hyperlink. Here we provide a quick tutorial on how to create a shortcode. We favour WordPress as our website platform of choice because it is so widely used, well supported, intuitive for non-technically minded administrators and, perhaps most importantly, customizable.
