Pagination on category/year/ is broken
-
Hi there.
I’m using the standard loop to present a list of posts in a certain category (see https://www.frizon.nu/nyheter/). You can also view it as by category AND year like this: https://www.frizon.nu/nyheter/2009.
My permalinks are: category/year/post-title.
Pagination works great while looking at the category, but stops working when browsing by year AND category. I get a 404 when trying to reach: https://www.frizon.nu/nyheter/2009/page/2/ but it works for: https://www.frizon.nu/nyheter/page/2/
Here’s my code:
<?php if (have_posts()) : ?> <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?> <?php /* If this is a category archive */ if (is_category()) { ?> <h2 class="sub-h2"><?php echo single_cat_title(); ?></h2> <?php /* If this is a tag archive */} elseif (is_tag()) { ?> <h2 class="sub-h2"><?php single_tag_title('Etikett: '); ?></h2> <?php /* If this is a daily archive */ } elseif (is_day()) { ?> <h2 class="sub-h2">Arkiv f?r <?php the_time('F jS, Y'); ?></h2> <?php /* If this is a monthly archive */ } elseif (is_month()) { ?> <h2 class="sub-h2">Arkiv f?r <?php the_time('F, Y'); ?></h2> <?php /* If this is a yearly archive */ } elseif (is_year()) { ?> <h2 class="sub-h2">Arkiv f?r <?php the_time('Y'); ?></h2> <?php /* If this is a search */ } elseif (is_search()) { ?> <h2 class="sub-h2">S?kresultat</h2> <?php /* If this is an author archive */ } elseif (is_author()) { ?> <h2 class="sub-h2">F?rfattararkiv</h2> <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> <h2 class="sub-h2">Bloggarkiv</h2> <?php } ?> <ul class="archive-list"> <?php while (have_posts()) : the_post(); ?> <li> <span class="archive-date"><?php the_time('Y.m.d'); ?></span> <a href="<?php the_permalink() ?>"><?php the_title(); ?></a> </li> <?php endwhile; ?> </ul> <div class="float-left"><?php next_posts_link('« ?ldre inl?gg') ?></div> <div class="float-right"><?php previous_posts_link('Nyare inl?gg »') ?></div> <?php else : ?> <h2 class="sub-h2">404-Not found</h2> <?php endif; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Pagination on category/year/ is broken’ is closed to new replies.