WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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:


share|improve this answer

Your Answer


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.