paging more categories
-
the problem is quite simple:
I have pagination for the archives pages which works fine IF the archive page shows only one category.
If the page is showing posts from more than one category then paging fails and gives back error such as “nothing found” starting from th second page ./page/2For paging I use this function which also shows numbers/links between prev and next button;
[Code moderated as per the Forum Rules. Please use the pastebin]
In oreder to recall the function in the loop:
<?php if (function_exists("pagination")) { pagination($additional_loop->max_num_pages); } ?>
The query for the page is:
<?php if (is_category('notizie')) { ?> <?php query_posts('cat=42,55,82'); ?> <?php } elseif (is_category('alpinismo')) { ?> <?php global $query_string; query_posts($query_string); ?> <?php } elseif (is_category('freeride')) { ?> <?php global $query_string; query_posts($query_string); ?> <?php } else { ?><?php } ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
For category “notizie” it shows posts from cat ID 42,55,82 nut paging is not working. Is I set the query to show only cat ID 42 for category “notizie” (1 category instead of 3), paging is working fine….
Any idea on how to let the paging work in pages showing posts from more than 1 category?
many thanks in advance…
- The topic ‘paging more categories’ is closed to new replies.