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

This should be easy. I need to query to display one page in a tab. Just pull one page by one query, but I'm doing something (maybe lots) wrong here:

Edit: Hah. I forgot the_content It works now.


$the_query = new WP_Query; $the_query->query ('pagename=about' );

while ($the_query->have_posts()) : $the_query->the_post(); ?>

<?php the_content(); ?>  //forgot this

<?php endwhile; ?>
share|improve this question
Query works fine for me, try chucking in a wp_reset_query() before (and possibly after) your custom query and see if that helps.. – t31os Apr 3 '11 at 17:50
Thanks. That's a good point. But. Arggg... I forgot the_content. Works now. – markratledge Apr 3 '11 at 18:39
up vote 1 down vote accepted

Hah. I forgot <?php the_content(); ?>

share|improve this answer

Shouldn't this be $the_query = new WP_Query('pagename=about'); ?

share|improve this answer
Nope, either method is valid.. – t31os Apr 3 '11 at 18:28
Ah ok - I didn't realise have_posts() also executed the query – anu Apr 3 '11 at 19:23

If there is only one page to call, why use "while"? Look:

<?php $query = new WP_Query;
$query->query ('pagename=about');
the_content(); ?>
share|improve this answer
Glancing at the comments on the original question, the OP apparently got it to work. – Pat J Apr 18 '14 at 2:52

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.