Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using the following line to show content from one page on another.

This line outputs the content's raw text of a shortcode:

<?php $id=3934; $post = get_page($id); $content = apply_filters('the_content', $post->post_content); echo $content;  ?>

How can I add to or filter this snippet to allow the shortcodes from said page to fully display, rather than outputting raw [/tab] text?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

If you want to display the shortcodes in the string variable $content you can use the Wordpress function do_shortcode() like this:

 echo do_shortcode($content); 

See more in the Codex:

http://codex.wordpress.org/Function_Reference/do_shortcode

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.