Support » Fixing WordPress » Category archive links gives me 404

  • Hi,

    I’m currently working on a new theme and I ran into some problems with the categories. The links:

    <div class="alignleft"><?php next_posts_link('Older posts') ?></div>
    <div class="alignright"><?php previous_posts_link('Newer posts') ?></div>

    Work on my main page but on my category pages they return a 404.

    I’ve removed the following code from my theme (which WordPress Default theme has):

    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
     	  <?php /* If this is a category archive */ if (is_category()) { ?>
    		<h2 class="pagetitle">Archive for the ‘<?php single_cat_title(); ?>’ Category</h2>
     	  <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    		<h2 class="pagetitle">Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
     	  <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    		<h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2>
     	  <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    		<h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2>
     	  <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    		<h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
    	  <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    		<h2 class="pagetitle">Author Archive</h2>
     	  <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    		<h2 class="pagetitle">Blog Archives</h2>
     	  <?php }?>

    But I’ve tried copying the whole code from Archives.php from WordPress Default Theme and replace it with my code and the links still don’t work so the error must be somewhere else.

    In it’s suggested that you put in a category base and a tag base under Permalinks in settings. I’ve tried this and it doesn’t work.

    If I change the Permalinks to defualt the site doesn’t work. At the moment I have the following custom structure on my permalinks: /%category%/%postname%/

    It’s pretty annoying since everything else works :S

  • The topic ‘Category archive links gives me 404’ is closed to new replies.