Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 Jan 15 '12 at 3:22

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

2 Answers 2

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! – user1149955 Jan 15 '12 at 12:36


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

More info:

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.