• Hi there,

    So basically I’ve got a minor issue I’m struggling to get to the bottom of, and was hoping some kind soul out there somewhere or other may be able to help..!

    I’m having an issue with the archived pages of the ‘Live’ category on my site, Dots & Dashes. All is functioning fine and dandy, ’til I hit page 21 of the archives, at which point I’m getting a ‘Page Not Found’ error…

    Any ideas, anyone..?

    Thanks!
    Josh.

Viewing 9 replies - 31 through 39 (of 39 total)
  • You can remove anything where the line starts // but it justs helps you remember what the code does!

    That line is quite important!

    Thread Starter dotsanddashes

    (@dotsanddashes)

    OK so it’s all now bang on! Apart from one slight thing: I’m now picking up ten, as opposed to six reviews per page…

    I’ve got this as the applicable bit of code:

    }
        if ( is_category( 111 ) ) {
            $query->set( 'posts_per_page', 6 );
            return;

    though it’s not working as it should..?

    Thread Starter dotsanddashes

    (@dotsanddashes)

    Oh, and this is the category-review.php I’m using:

    <?php
    /**
     * The template for displaying Reviews Category Archive pages.
     *
     *
     * @package DotsAndDashes
     *
     */
    get_header(); ?>
    		<div id="container">
    			<div id="content" role="main">
    
    				<h1 class="page-title">Reviews</h1>
    				<?php
    					$category_description = category_description();
    					if ( ! empty( $category_description ) )
    						echo '<div class="archive-meta">' . $category_description . '</div>';
    
    				?>
    
    <?php if ( ! have_posts() ) : ?>
    	<div id="post-0" class="post error404 not-found">
    		<h1 class="entry-title"><?php _e( 'Not Found', 'dotsanddashes' ); ?></h1>
    		<div class="entry-content">
    			<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'dotsanddashes' ); ?></p>
    			<?php get_search_form(); ?>
    		</div><!-- .entry-content -->
    	</div><!-- #post-0 -->
    <?php endif; ?>
    
    <?php
     $counter = 0;
    while ( have_posts() ) : the_post(); ?>
    <?php
    	$counter++;
    		if ($counter%2 == 0 ) { $post_class = 'fr';  }
    		else { $post_class = 'fl'; }
    
     ?>
    		<div id="post-<?php the_ID(); ?>" <?php post_class(array('review-item',$post_class )); ?>>
    			<div class="thumb-wrapper">
    				<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo( 'template_url' ); ?>/thumb.php?src=<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID));  ?>&h=350&w=350" alt="<?php echo the_title(); ?>"/></a>
    			<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'dotsanddashes' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php  echo get_post_meta($post->ID, 'Artist', true); ?><br><?php  echo get_post_meta($post->ID, 'Album', true); ?></a></h2>
    			</div>
    		</div><!-- #post-## -->
    
    		<?php comments_template( '', true ); ?>
    <?php endwhile; // End the loop. Whew. ?>
    
    <?php /* Display navigation to next/previous pages when applicable */ ?>
    <?php if (  $wp_query->max_num_pages > 1 ) : ?>
    				<div id="nav-below" class="navigation">
    					<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav"></span> <span class="pagi-bracket">[</span>Older<span class="pagi-bracket">]</span>', 'dotsanddashes' ) ); ?></div>
    					<div class="nav-next"><?php previous_posts_link( __( '<span class="pagi-bracket">[</span>Newer<span class="pagi-bracket">]</span> <span class="meta-nav"></span>', 'dotsanddashes' ) ); ?></div>
    				</div><!-- #nav-below -->
    <?php endif; ?>
    
    			</div><!-- #content -->
    		</div><!-- #container -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    The code looks fine. I’m seeing 4 posts per page https://dotsanddashes.co.uk/reviews/page/2/

    Thread Starter dotsanddashes

    (@dotsanddashes)

    yeah, me too… How do I get that to six, though..?

    I guess you found the error as it looks good now yay ??

    BTW, very cool site, I love your custom styling!

    Thread Starter dotsanddashes

    (@dotsanddashes)

    Yeah, just about sussed it out in the end. Phew!

    And thank you very much! Took a while to get everything right, though reckon it was more or less worth it in the end..!

    Oh and thank you for all your help, of course!

    Next time just send me the theme folder and I’ll sort it out. Will save a lot of time! But its good to learn how to debug things yourself.

    Thread Starter dotsanddashes

    (@dotsanddashes)

    That’s really kind of you?– thanks! But yeah, absolutely, trying to get as firm a grip on the inner workings as possible..!

Viewing 9 replies - 31 through 39 (of 39 total)
  • The topic ‘Advanced pages of category not found…’ is closed to new replies.