I develop a new theme for wordpress 3.3.1 from scratch and shortcodes are not working on it. As I searched until now it is a matter of filtering the content containing the shortcode, filter code added in a theme specific location(shorcodes are working with another theme). So, my question is : What is the code for a general shortcode theme enable ?
To execute a single shortcode, run it with
echo do_shortcode('[your_short_code]');
If the shortcode(s) are in the post content, make sure you're displaying it with
<?php the_content();?>
Or
<?php echo apply_filters('the_content',$post_content);?>
Or
<?php echo apply_filters('the_content',$wp_query->post->post_content);?>
The important thing is: if you aren't using the function "the_content()" you need this line <?php echo apply_filters('the_content',$wp_query->post->post_content);?>
where in the second argument you have to put the variable of the post content you want to show.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With