yaylitzis
yaylitzis

Reputation: 5534

Add shortcode inside another with echo

I try to nest a shortcode to another in my page. Why this isnt working?

[toggle] 
     <?php echo do_shortcode('[Best_Wordpress_Gallery id="1" gal_title="my"]'); ?> 
[/toggle]

Upvotes: 0

Views: 380

Answers (1)

michaelcarwile
michaelcarwile

Reputation: 86

There's not enough information in your code sample to say for sure. However, it looks like you are attempting to put PHP code into an actual WordPress page/post. Is that the case? If not, please provide more info on what you're trying to do exactly.

If so, you can't put PHP inside post/page content in WordPress without enabling the ability to do so. The easiest way to do this is with a plugin. There are several in the Plugin Directory: https://wordpress.org/plugins/search.php?q=php+code.

Also, see this answer for a similar question: https://stackoverflow.com/a/18896308/3147332

Upvotes: 1

Related Questions