Advertisement
ulfben

Adding pagination to FreshFolio theme

Apr 6th, 2012
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.48 KB | None | 0 0
  1. <?php
  2. /* discussion: http://themefuse.com/forum/freshfolio-wp/adding-pagination */
  3. ?>
  4. <?php else: ?>
  5.     <li><p><?php _e('Sorry, no posts matched your criteria.', 'tfuse') ?></p></li>
  6. <?php endif; ?>                    
  7. <?php /*start pagination mod*/
  8. global $wp_query;
  9. $total = $wp_query->max_num_pages;                             
  10. if($total > 1) :                     
  11.     if(!$current_page = $paged){
  12.         $current_page = 1;
  13.     }
  14.     $haveperm = get_option('permalink_structure');
  15.     $format = empty($haveperm) ? '&page=%#%' : 'page/%#%/';
  16. ?> 
  17.     <li>
  18.         <div class="slide_image"><div class="border_image">
  19.             <?php if ($total > $current_page){
  20.                 next_posts_link('<img src="'.get_bloginfo('template_directory').'/images/next_page_home.png" />','');
  21.             }else{
  22.                 previous_posts_link('<img src="'.get_bloginfo('template_directory').'/images/prev_page_home.png" />','');
  23.             }?>
  24.         </div></div>
  25.         <div class="slide_content">
  26.             <div class="slide_title"><h2><?php next_posts_link('Next Page'); ?></h2></div>
  27.             <div class="slide_meta">
  28.             <?php echo paginate_links(array(
  29.                     'base' => get_pagenum_link(1) . '%_%',
  30.                     'format' => $format,
  31.                     'current' => $current_page,
  32.                     'total' => $total,
  33.                     'mid_size' => 4,
  34.                     'type' => 'plain'
  35.                 ));
  36.             ?>
  37.             </div>
  38.         </div>
  39.         <div class="scroll_navi"><a href="#" class="scroll_prev"><?php _e('Prev', 'tfuse') ?></a> <a href="#" class="scroll_next"><?php _e('Next', 'tfuse') ?></a></div>               
  40.     </li>
  41. <?php endif; /*end pagination mod*/?>
  42.         </ul>
  43.         <div class="clear"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement