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

Trying to query pages based on the category they are associated with. I am passing in the cat_ID, but it doesn't seem to be working. Always returns a single post with the title "Hello World" while there is an actual page with real title associated with this category.

// The Query

// The Loop
while ( have_posts() ) : the_post();



// Reset Query
share|improve this question
up vote 0 down vote accepted

It's because the default query is only querying for post_type post, you have to explicitly add page to get it to also query for pages:

$args = array(
    'cat' => $current,
    'post_type' => array( 'page', 'post' )
query_posts( $args );
share|improve this answer
Ahh ha! Thanks, – Louis W Oct 2 '11 at 17:59

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.