• Resolved mmadden

    (@mmadden)


    Please see https://temp.donelsonhills.com/category/association-meetings/

    If I advance to page 2 then

    get_header(); ?>
    JOINUS
    Illustration: Phil Ponder
    Site design and development: Matthew Madden

    is echoed to the screen. On the Beautification Projects category page, clicking on the next page returns the next 6 posts as expected. Only a couple of the second category pages are failing. The rest seem to be working fine.

    Below is the code for the category.php file…

    <?php get_header(); ?>
    <div class="welcome"><?php wp_title(""); ?></div>
    <div class="content">
    	<?php
    	$thecatid = get_query_var('cat');
    	$args = array(
    		'paged' => get_query_var('paged'),
    		'cat' => $thecatid,
    		'posts_per_page' => 6
    		);
    	$the_query = new WP_Query( $args ); ?>
    	<?php wp_pagenavi(array( 'query' => $the_query)); ?>
    	<?php while ( $the_query->have_posts()) : $the_query->the_post(); ?>
    
    	<div class="homePosts">
    		<h2 class="postTitle h2"><?php echo the_title(); ?></h2>
    		<?php
    		if ( get_the_post_thumbnail($post_id) != '' ) {
    			echo '<a href="'; the_permalink(); echo '" class="thumbnail-wrapper">';
    				the_post_thumbnail('medium');
    			echo '</a>';
    		} else {
    			echo '<a href="'; the_permalink(); echo '" class="thumbnail-wrapper">';
    			echo '<img src="';
    			echo catch_that_image();
    			echo '" alt="" />';
    			echo '</a>';
    		}
    		?>
    		<?php the_excerpt(); ?>
    	</div>
    	<?php endwhile; wp_reset_postdata(); wp_reset_query(); ?>
    </div>
    <?php include('sidebar.php'); ?>
    <?php get_footer(); ?>

    Any help is much appreciated.

    https://www.ads-software.com/plugins/wp-pagenavi/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Page 2 of category page in only some categories not working’ is closed to new replies.