-
WordPress Short Codes in Templates
Posted on December 1st, 2009 1 commentHow do you put shortcodes in your template files?
I came across a problem the other day. I found a plugin I wanted to use but it didn’t have any php calls to invoke it, only WordPress shortcodes. I scanned the forums and found a very good alternative from Dukessa. By using a WordPress call to the short code I could add the call to the header.php file.
Here is the call format:
<?php echo do_shortcode(’[shortcode]‘); ?>
Here is an example of how to embed a short code in a header.php file for NextGEN Gallery plugin.
<?php echo do_shortcode(’[slideshow id=1]‘); ?>
Give it a try, it works great.
Plurk This Post
Digg This Post
Ping This Post
Stumble This PostOne Response to “WordPress Short Codes in Templates”
-
You’ve done it again! Incredible article!
Leave a Reply
-
Bad Behavior has blocked 264 access attempts in the last 7 days.
Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.


