Pagination problem
-
I try to get a category depended pagination. But unfortunately from second page on the then listed posts are mixed up with all categories, although the url shows that the original category is still fired. Could anybody identify the failure in my code?
<?php $currentCategory = single_cat_title("", false); $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $queryObject = new Wp_Query( array( 'showposts' => 7, 'category_name' => $currentCategory, 'post_type' => array('post'), 'orderby' => 1, 'posts_per_page' => 3, 'paged' => $paged ) ); // The Loop if ( $queryObject->have_posts() ) : $i = 0; while ( $queryObject->have_posts() ) : $queryObject->the_post(); if ( $i == 0 ) : ?> // Here comes a lot of loop related stuff <?php endif; $i++; endwhile; ?> <div class="nav-previous alignleft"><?php previous_posts_link('Zurück', $queryObject->max_num_pages); ?></div> <div class="nav-next alignright"><?php next_posts_link('Weiter', $queryObject->max_num_pages); ?></div> <?php wp_reset_postdata(); endif; ?>
Thanks in advance,
benraaa
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Pagination problem’ is closed to new replies.