SHARE
TWEET

feed bravo

a guest Feb 14th, 2016 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.    
  3.     $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
  4.  
  5.     $custom_args = array(
  6.         //'offset' => 1,
  7.         'post_type' => 'post',
  8.         'posts_per_page' => 2,
  9.         'paged' => $paged
  10.     );
  11.  
  12.     $custom_query = new WP_Query( $custom_args ); ?>
  13.  
  14. <?php
  15.     if ( $custom_query->have_posts() ) : ?>
  16.  
  17.     <!-- the loop -->
  18.     <?php while ( $custom_query->have_posts() ) : $custom_query->the_post(); ?>
  19.         <div class="item">
  20.             <h3><?php the_title(); ?></h3>
  21.             <div class="content"><?php the_excerpt(); ?></div>
  22.       </div>
  23.     <?php endwhile; ?>
  24.     <!-- end of the loop -->
  25.  
  26.     <!-- pagination here -->
  27.     <?php
  28.         if (function_exists(custom_pagination)) {
  29.             custom_pagination($custom_query->max_num_pages,"",$paged);
  30.         }
  31.     ?>
  32.  
  33.     <?php wp_reset_postdata(); ?>
  34.  
  35.     <?php else:  ?>
  36.         <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
  37.  
  38.     <?php endif; ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top