Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
- $custom_args = array(
- //'offset' => 1,
- 'post_type' => 'post',
- 'posts_per_page' => 2,
- 'paged' => $paged
- );
- $custom_query = new WP_Query( $custom_args ); ?>
- <?php
- if ( $custom_query->have_posts() ) : ?>
- <!-- the loop -->
- <?php while ( $custom_query->have_posts() ) : $custom_query->the_post(); ?>
- <div class="item">
- <h3><?php the_title(); ?></h3>
- <div class="content"><?php the_excerpt(); ?></div>
- </div>
- <?php endwhile; ?>
- <!-- end of the loop -->
- <!-- pagination here -->
- <?php
- if (function_exists(custom_pagination)) {
- custom_pagination($custom_query->max_num_pages,"",$paged);
- }
- ?>
- <?php wp_reset_postdata(); ?>
- <?php else: ?>
- <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement