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…..
Hi there! I am new to shortcode and I need to simply display post counts by a user. What should I do to get this placed into a custom wordpress page that I have created?