Is it possible to use the do_shortcode() method inside a template part? In particular I have a custom post type (being displayed using a child theme) where I want to populate a 'toggle'. I tried to use
<?php echo do_shortcode("[toggles]");
...but I dont know if that shortcode is recognized by the API. If if *did* work, would I then have to "close" the shortcode
<?php echo do_shortcode("[/toggles]");
I have limited experience creating custom templates in WP, please pardon my ignorance.
Try adding the shortcode in the page as you want and then copy paste it in the do_shortcode php function. Make sure you are using single quotes inside the shortcode text.
Is it possible to use the do_shortcode() method inside a template part? In particular I have a custom post type (being displayed using a child theme) where I want to populate a 'toggle'. I tried to use
<?php echo do_shortcode("[toggles]");
...but I dont know if that shortcode is recognized by the API. If if *did* work, would I then have to "close" the shortcode
<?php echo do_shortcode("[/toggles]");
I have limited experience creating custom templates in WP, please pardon my ignorance.
Hey,
Try adding the shortcode in the page as you want and then copy paste it in the do_shortcode php function. Make sure you are using single quotes inside the shortcode text.
Thanks
ThemeNectar Support Team