So Easy Even a Chimp Can Do It!
RSS icon Email icon Bullet (black)
  • WordPress Short Codes in Templates

    How 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.

Bad Behavior has blocked 771 access attempts in the last 7 days.