How to use WordPress Shortcode in template

January 13, 2019 by admin

How to use WordPress Shortcode in template

Shortcodes in WordPress are little bits of code that allow you to do various things with little effort. You can use in the content area to invoke some kind of function to accomplish certain tasks.

But what if you want to use a shortcode from within a template instead of with the content of a Post/Page? You can invoke it with a special function:

<?php echo do_shortcode("[shortcode]"); ?>

Leave a Reply

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

Get in touch today and see how we can help your business start to grow.

Contact us