Advertisement
abdulawal39

Query Posts pagination issue solved

Dec 21st, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 KB | None | 0 0
  1. <?php get_header();?>
  2.             <div style="clear:both"></div>
  3.             <div class="maincontent_area fix">
  4.                 <div class="content_left floatleft fix shadow">
  5.                
  6.     <?php if(!is_paged()) { ?>
  7.                 <?php
  8.                     $args = array( 'post_type' => 'post','posts_per_page' => 2, 'paged' => $paged );
  9.                     $loop = new WP_Query( $args );
  10.                 ?>  
  11.                 <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
  12.            
  13.            
  14.                     <div class="single_content fix">
  15.                         <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  16.                         <a href="<?php the_permalink();?>"><?php the_post_thumbnail('thumb', array('class' => 'imgthumb')); ?></a>
  17.                         <p><?php echo excerpt('60'); ?> </p>
  18.                         <?php get_template_part( 'postmeta' ); // Post Meta (postmeta.php) ?>
  19.                        
  20.                     </div>
  21.                     <div class="line fix"></div>
  22.  
  23.                    
  24.                    
  25.                    
  26.                    
  27.                 <?php endwhile; ?>
  28.                 <?php wp_reset_query(); ?>
  29.                 <?php } ?> 
  30.                
  31.  
  32.                
  33.  
  34.         </div>
  35.  
  36.  
  37.     <?php if (function_exists("pagination")) {
  38.              pagination($additional_loop->max_num_pages);
  39.      } ?>
  40.                
  41.  
  42. <?php get_sidebar();?>
  43.             </div>
  44.         </div>
  45. <?php get_footer();?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement