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 know pagination isn't as straight forward with WP_Query as it is with other loop types but normally I don't have a problem with it.

I'm editing a site for a client and this is their current loop;

    $temp_post = $post;
    $args = array(
        'ignore_sticky_posts' => 1,
        'posts_per_page' => 5,
        'post_type' => 'project'            
    $projects = new WP_Query( $args );
    while ($projects->have_posts()) : $projects->the_post();

    <!-- loop content -->

    $post = $temp_post;

I tried my usual method of using $wp_query instead of $portfolio but that didn't work.

Anyone have any ideas?

share|improve this question

I think you have to add page or paged argument to your WP_Query. Take a look at WP_Query Pagination Parameters.

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.