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 creating a single page site and obviously want to include the blog posts. I'm currently looping through the pages and using the_content() and the_title() to display them. However, the_content doesn't include the blog posts on the blog page. I tried another loop in this one, but it didn't work. Any ideas to point me in the right direction? Thanks

share|improve this question

migrated from stackoverflow.com Jan 15 '12 at 3:22

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

To include posts and pages in the loop, use the 'post_type' argument:

$wp_query = new WP_Query();
$args = array(
     'post_type' => array('post','page')
while ($wp_query->have_posts()) : $wp_query->the_post();

<?php the_content(); ?>

<?php endwhile; ?>


share|improve this answer
Ah didn't think to use post_type, thanks a bunch. I can definitely use this help. Thanks! – tristan Jan 15 '12 at 12:36

From http://codex.wordpress.org/The_Loop_in_Action

if (have_posts()) :
  while (have_posts()) :

More info: http://codex.wordpress.org/The_Loop

If you want more help, post some code!

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.