Created
November 18, 2014 06:18
-
-
Save avclark/aca655d0ccca6e82f364 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$temp = $wp_query; | |
$wp_query = null; | |
$wp_query = new WP_Query(); | |
$wp_query->query('showposts=6&post_type=news'.'&paged='.$paged); | |
while ($wp_query->have_posts()) : $wp_query->the_post(); | |
?> | |
<!-- LOOP: Usual Post Template Stuff Here--> | |
<?php endwhile; ?> | |
<nav> | |
<?php previous_posts_link('« Newer') ?> | |
<?php next_posts_link('Older »') ?> | |
</nav> | |
<?php | |
$wp_query = null; | |
$wp_query = $temp; // Reset | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code is for Custom Query Pagination. You can follow the steps to create your own pagination in WordPress.
Reference : https://www.wpblog.com/use-wp_query-to-create-pagination/