How to use WordPress shortcode outside in your theme files

Simply use the do_shortcode() function anywhere in your theme file. The shortcode you want to use have to be given to the function as shown below:

<?php do_shortcode('[gallery]'); ?>

That’s all :)

Recipe initially published on CatsWhoCode.

Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!

How to use WordPress shortcode outside in your theme files

Leave a Reply

Your email address will not be published. Required fields are marked *