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 setting up a blog that I'm trying to integrate the posts of into old site pages. The

$id = $_GET['article_id'];
$post = get_post($id);
echo $post->post_content;

However, when I echo the blog post from $post->post_content, it seems that the html has been stripped out. The lines all run together. There are line breaks in the source, but there are no html <BR>s or <p>s. However, the post looks fine when I view it through the actual WordPress page.

I have to use <pre> to get it to display properly, but then on the page, lines don't wrap and it defaults to that typewriter font.

What am I doing wrong?

share|improve this question
up vote 1 down vote accepted

Post content, stored in database, is not equal to what gets displayed. It should be displayed with template tag function or at least run through the_content filter. Try:



echo apply_filters( 'the_content', $post->post_content );
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.