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?

1 Answer 1


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:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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