Daily Tip: How to Use a WordPress Shortcode Outside of the Post Editor
July 26, 2010
Here’s a handy tip from the codex. If you want to use a shortcode outside of the WordPress post or page editor, you can use this snippet to output from the shortcode’s handler(s):
// Use shortcode in a PHP file (outside the post editor). <?php echo do_shortcode('[gallery]'); ?>
Replace with the shortcode you want to use. More information is available in the WordPress codex on the do_shortcode function page.
Because this plugin/widget is provided free of charge, I simply ask you to link back to Pressography.com in a post on your blog, or from one of your sites. It doesn't need to be anything fancy - just a note saying that you're using it, and whether or not you like it. However, there is no requirement that you do this, you're free to use the plugin regardless.



Comments
Got something to say?