• Resolved janleeks

    (@janleeks)


    Hello,
    Hoping someone can help me with this, pagination is working fine on the master blog page
    https://sitepreview.annscott.co.uk/blog-2 but not on a category specific page
    https://sitepreview.annscott.co.uk/clients

    Here is my code… going mad with this one

    <?php
    
      /**
      *@desc A page. See single.php is for a blog post layout.
      Template Name: clients2
      */
    
      get_header();
    
      if (have_posts()): ?>
    
     <?php include (TEMPLATEPATH . '/nav2.php'); ?>
          <div id="maincontent">
          <div id="intro">
    <h1>CLIENTS</h1>
    <p class="introcopy">content here.</p>
    <p class="bottomheader">&nbsp;</p>
    </div>
    
                     <div id="secondaryContent">
           <?php include (TEMPLATEPATH . '/testsidebar.php'); ?>
          </div>
    
      <ul id="destinations">
    
      <?php query_posts('posts_per_page=5&&category_name=clients&orderby=title&order=asc');
      ?>
    
    <?php while (have_posts()) : the_post(); ?> 
    
        <li id="post-<?php the_ID(); ?>">
    
         <div class="imagehold2">
    	 <?php the_content(__('(more...)')); ?></div>
    
          <span class="desheader"><?php the_title(); ?></span>
    
           <?php the_excerpt(); ?> 
    
     </li>
    
        <?php endwhile; ?>
    
      </ul>
    
    <?php else: ?>
    
      <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    
    <?php
    
      endif;
      ?>
    
      <div id="pagination" class="noline">
    
         <?php if(function_exists('wp_paginate')) {
        wp_paginate();
    } ?>
    
       <div class="top"><a href="#">back to top</a></div>
        </div>
    
    <?php wp_reset_query(); ?>
    
      <?php
      get_footer();
    ?>

    https://www.ads-software.com/extend/plugins/wp-paginate/

    many thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter janleeks

    (@janleeks)

    fixed it with

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("category_name=clients&orderby=title&order=asc&posts_per_page=10&paged=$paged"); ?>
            <?php while (have_posts()) : the_post(); ?>

    so happy!

    janleeks – glad you got it figured out!

    -Eric

    This solved my problem too..Thanks! – Now the only thing is…the active class on the pagination numbers does not change. No matter what page I’m on, “1” is always active. Any ideas?

    Now the only thing is…the active class on the pagination numbers does not change. No matter what page I’m on, “1” is always active. Any ideas?

    NM. I had my pagination tag within the wrong query. woops.

    Excuse me, where does text go? In what file?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[plugin : WP-Paginate] works on my index.php but not on category specific page’ is closed to new replies.