• I’m currently using a couple plug-ins that require me to place their shortcode in the New Post content field, but I’m wondering if there is a way to place it within my template code instead? For example, I have custom fields that the user fills out which transfers to the live site, but I’d rather not put it on them to remember they need to place shortcode in the content field. There has to be a way to place this in the loop or something.

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter get_username

    (@get_username)

    I found this, but I’m not sure it’s the right solution.

    Link to other WordPress forum topic

    It states this as the answer and only if the plug-in supports shortcode outside the post.

    <?php echo do_shortcode(‘[catlist id=1 numberposts=5)]’); ?>

    Does this look correct? The problem I see with this is if there are variables. I have one shortcode just called [cardealer] while another actually calls for the ID number [nggallery id=3].

Viewing 1 replies (of 1 total)
  • The topic ‘Shortcode within the template question’ is closed to new replies.