Using theme shortcodes inside a pagetemplate and php
-
I am trying to use a theme’s shortcode inside a pagetemplate-file. For example my theme has a section-shortcode:
[section bgcolor=”#e6e6e6″ padding=”80px 0″]
When I try to put that inside a page’s template-file the code is printed as is. Also when trying to use it with php in page content I get the same result:
echo do_shortcode(‘[section bgcolor=”#e6e6e6″ padding=”80px 0″]’);
Any hints?
For the php-problem I found that this should work:[php]
do_shortcode(‘[section bgcolor=”#e6e6e6″ padding=”80px 0″]’);
[/php]But with that I get no result at all. I have installed “allow PHP in posts”-plugin so php works on my site ok otherwise.
The topic ‘Using theme shortcodes inside a pagetemplate and php’ is closed to new replies.