Recently, we got a request from a user asking how they could use WordPress shortcodes in their WordPress themes. Shortcode is a special tag that you can enter into a post that gets replaced with different content when actually viewing the post on the website. If you have ever embedded a WordPress gallery on your blog, then you’ve already seen the built in shortcode. Check out our article on adding shortcodes in your themes.
Thankfully, WordPress has a very easy function called do_shortcode() that lets you add shortcodes in your themes. Simply add the code like this:
<?php echo do_shortcode("[example_shortcode]"); ?>
Simple and easy