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

I want to populate the "Greenway News" box on this page with the three latest headlines from the site's Press section AND blog.

The blog is a regular WP blog and I am currently using this code to get my results:

<?php query_posts('cat=3&posts_per_page=3'); ?> 

The Press page is a custom post type. I can get the following code to work as well:

   query_posts( array( 'post_type' => 'portfolio', 'toolkit' => '2011' ) );
   //the loop start here
   if ( have_posts() ) : while ( have_posts() ) : the_post();

Is this possible?

share|improve this question
take a look at codex.wordpress.org/The_Loop#Multiple_Loops – Bainternet Mar 3 '11 at 17:06
I've added an answer that assumes you want to show posts and your CPT in the same loop – anu Mar 3 '11 at 17:12

You're nearly there, you just need to tell WP that you want to query posts as well as your Press CPT.


query_posts( array( 'post_type' => array('posts', 'portfolio'), ...);

where portfolio is the name of your custom post type.

The relevant Codex page


So this is how the query should look


  $args = array('post_type'=>array('posts', 'portfolio'));


  if ( have_posts() ) : while ( have_posts() ) : the_post();

share|improve this answer
Thank you for all the help. Yes, I want this in the same loop. @Anu: I tried following the suggestion. This is the code I came up with. <?php query_posts ( array('post_type' => array('cat=1', 'portfolio', 'Year of Article' => '2011' ) )); //loop if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> Unfortunately, it only shows the custom post type (Press Articles) not the posts. brooklyngreenway.org/?page_id=1037&preview=true @Anu, did I do something dumb? Thank you for any help. – Jeff Tancil Mar 4 '11 at 19:13
I've updated my answer, but you've added some extra parameters (eg Year of Article) that aren't to do with the original question – anu Mar 8 '11 at 13:22

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.