Support » Themes and Templates » 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 You can also view it as by category AND year like this:

    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: but it works for:

    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(); ?>
    				<span class="archive-date"><?php the_time('Y.m.d'); ?></span>
    				<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
    			<?php endwhile; ?>
    			<div class="float-left"><?php next_posts_link('&laquo; Äldre inlägg') ?></div>
    			<div class="float-right"><?php previous_posts_link('Nyare inlägg &raquo;') ?></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.