Shortcodes in templates

If you are using shortcodes, you might want to add them in a template page instead of in the content of a page or post. Luckily, WordPress has a function for this; do_shortcode.

You can add this anywhere you want your shortcode.

Code Snippet:

<?php echo do_shortcode("&#91;my_shortcode&#93;"); ?>

Posted in Snippets