WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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

All, I'm trying to have a side navigation menu that once you click on a link it basically pulls the content of that wordpress page and displays it. I've got the following code to do this:

$qry = "Select post_content from wp_jjfuap_posts where ID='$menu->object_id'";
$result = mysql_query($qry);
$resultset = mysql_fetch_array($result);
$output = apply_filters( 'the_content', $resultset['post_content'] );

The issue is that it doesn't translate any HTML. It simply just displays the HTML. For example, it will output the following:

<ul><li>Test</li><li>Another test</li></ul>
<img src=”http://www.website.com/wp-content/uploads/2011/10/team.jpg” alt=”" width=”300″ height=”240″ /> <h2 style=”margin: 25px 0 0 0;”>Al</h2> <span class=”small”><em>Person</em></span> <p style=”text-align: justify;”>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris lacinia justo quis neque da</p>

How can I get Wordpress to actually display the correct HTML using this method?


share|improve this question
What do you mean, "translate" the html? – goldenapples Mar 16 '12 at 0:23
@goldenapples I just means it displays the HTML like that instead of actually dislaying the image or displaying the Test and Another Test in an unordered format list. – user1048676 Mar 16 '12 at 0:51

I changed the way I went about this and did this to solve it:

$page = get_page( $menu->object_id );
$output .= apply_filters( 'the_content', $page->post_content );

My information now shows up correctly.

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.