We are very familiar in using shortcodes for adding things to wordpress. Many themes are now coming with shortcode feature which can be used in post & pages. But in some cases we need to use the shortcode in our template file like if we wanna show in the footer or header or any other..
However, Here I’ll show you how to use shortcode in WordPress template file. Nothing complicated, just need to add small piece of code :
<?php echo do_shortcode('shortcode'); ?>
Use the above code anywhere in your template file where you want the shortcode to work/function.. Replace the (‘shortcode’) text with your shortcode.
Thanks for reading this & enjoy…..