What I’ve always thought would be a neat plugin would be something that gave users the ability to insert WordPress template tags from within the Write Post/Page screen. I’ve also gotten a few requests for this type of functionality.
Template Tag Shortcodes comes loaded with 40 shortcodes that represent their equivalent template tags.
For example, a commonly used template tag is wp_list_pages(). But, it’s a PHP function and can’t be used within the post editor (without a PHP plugin). With this plugin, you could simply type in
[wp_list_pages] and let the plugin do all the work.
The available shortcodes
If you know me, you know I can’t stop at one or two shortcodes. That’s why I made 40.
Several shortcodes have additional parameters, which are listed in the plugin’s
readme.html file. Here’s the list of what’s currently available in the plugin.
I’m sure more will be added over time. If you have a particular template tag you’d like to see as a shortcode, just let me know in the comments.
Some important notes
These shortcodes don’t provide additional XHTML formatting. For example,
[wp_list_pages] won’t be wrapped with the
<ul> tag. This is because its equivalent template tag
wp_list_pages() does not do this. So, you’ll want to add any additional formatting from within the post editor.
I struggled with this decision but thought it was the best route. The goal was to adhere to the same rules as the WordPress template tags.
Download the Template Tag Shortcodes plugin
Get the plugin. Enjoy. Let me know how it works out for you. For full instructions, see the
readme.html file included with the plugin download.
Please don't use my contact page or the comments section below to ask support questions. Use my support forums at Theme Hybrid, which is where I handle all support questions for my WordPress projects.
If you run across any bugs or want to share ideas about how to make this plugin better, feel free to post in the comments below.