• I have tried everything, but pagination just does not work.

    I am using:

    if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
    	elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
    	else { $paged = 1; }
    	query_posts( array( 'paged' => $paged ) );
    	$args = array(
    	           'cat' => '3',
    	           'post_type' => 'post',
    	           'posts_per_page' => 6,
    	           'category__not_in' => 69,
    	           'offset' => 1,
    	           );
    	query_posts($args);
    	while (have_posts()) : the_post();

    And my pagination code is:

    <div class="alignleft"><?php previous_posts_link('? Previous') ?></div>
         <div class="alignright"><?php next_posts_link('More ?') ?></div>

    When I go to page 2, the posts are still the same. Anything I should be looking at?

    Thanks
    Dave

Viewing 3 replies - 1 through 3 (of 3 total)
  • ‘paged’ and ‘offset’ do not work together in the same query.

    also, the first line with the ‘paged’ gets totally overwritten with the second query.

    what are you trying to jump with the offset?

    Thread Starter technique

    (@_davehall)

    Hi

    I did have the paged within the array but got frustrated and started trying everything out.

    I’ve just tried it without offset and it works! So what’s the alternative to ‘Offset’?

    I need offset as I have a featured post (most recent) that is styled differently at the top of page.

    Thanks

    I need offset as I have a featured post (most recent) that is styled differently at the top of page.

    if the code for it is in the same template, you can save the post ID of that post, and use 'post__not_in' in your query to exclude it;

    review all the suggestions in https://codex.www.ads-software.com/The_Loop#Multiple_Loops_in_Action

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pagination issues with query_posts and paged’ is closed to new replies.