WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] need a pagination solution or advice.. (6 posts)

  1. southcast
    Member
    Posted 2 years ago #

    Hi guys, Given below is a link to a custom page on my site I made out of archive.php as I needed the thumbnail layout like this, now the problem is the page loading has become very heavy as all the thumbnails tend to load at once and I am unable to render pagination as it is not a normal blog page so the plugins do not work.

    http://southcast.in/category/top-new-models-in-india/

    Any hacks or suggestions please ?

  2. egado
    Member
    Posted 2 years ago #

    Hm... loads really pretty... but if you want, you can try to include the pagination support for your custom template file:

    <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . 'Pages:' . '</span>', 'after' => '</div>' ) ); ?>

    So you can make use of <!--nextpage--> while editing the the page in your admin area...

    Or is this site build automaticly?

  3. southcast
    Member
    Posted 2 years ago #

    @egado , very kind of you to have a look. Could you please tell me where do I add this code , below is the current structure of my archive.php that I modified for this page.

    <?php get_header(); ?>
    
        <div id="content" class="col-full">
    		<div id="main" class="col-left">
    
    <!-- category-title -->
    
    <h1 class="title"> <?php if (is_category()) { single_cat_title(); } ?></h1>
    
    <!-category description-->
    <div id="catdes"><?php echo category_description(); ?></div>
    
    <?php echo the_extra_category_content(75); ?>
    
               <div id="catmain">
    
      <?php
      $thumbnails = get_posts('category_name=top-new-models-in-india&numberposts=-1');
      foreach ($thumbnails as $thumbnail) {
      if ( has_post_thumbnail($thumbnail->ID)) {
          echo '<a href="' . get_permalink( $thumbnail->ID ) . '" title="' . esc_attr( $thumbnail->post_title ) . '">';
          echo get_the_post_thumbnail($thumbnail->ID, 'category-thumb');
          echo '</a>';
        }
      }
    ?>  	
    
      </div>
    
    		</div><!-- /#main -->
        </div><!-- /#content -->
    
    <?php get_footer(); ?>
  4. southcast
    Member
    Posted 2 years ago #

    Dear @egado, I would really appreciate if you could tell me If I could make use of this plugin. I do not have the knowledge of css selectors though. Pardon my ignorance.

    http://wordpress.org/extend/plugins/infinite-scroll/

  5. egado
    Member
    Posted 2 years ago #

    Please have a try if that works for your pagination... its your new and improved archive.php :)

    //EDIT correction
    http://pastebin.com/r1WTx8RY

    And don't forget to change $thumbs_per_page = 2; as what you wish, maybe 10

    Plugin
    Sorry you have to try if you could is this plugin for your needs...

  6. southcast
    Member
    Posted 2 years ago #

    @egado, thanks you for going the extra mile, the code you provided however broke the site so I took the wp-pagenavi plugin and tweaked with the query-posts a bit and my job was done. I am closing this thread now.
    Again.. thank you !!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags