Blog » Using a shortcode in a WordPress theme
Currently working on a WordPress project and I needed to include a WordPress shortcode into the theme files. This is to include a gallery as the background on all the pages.
This is how you add a WordPress shortcode into the theme.
Open up the themes php file. The file i used on my project is page.php
Use the do_shortcode function as below:
<?php echo do_shortcode('[shortcode option="value"]'); ?>
The code which I used to display the gallery on every page is:
<?php echo do_shortcode('[portfolio_slideshow id=27]'); ?>