Last active
October 21, 2015 15:43
-
-
Save jpcontrerasv/480c2ceb597a33996a3b to your computer and use it in GitHub Desktop.
Paginar Post Type
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=5&post_type=blog'.'&paged='.$paged); | |
while ($wp_query->have_posts()) : $wp_query->the_post(); | |
?> | |
<?php endwhile; ?> | |
<nav> | |
<?php wp_pagenavi(); ?> | |
</nav> | |
<?php | |
$wp_query = null; | |
$wp_query = $temp; // Reset | |
?> | |
-------------- | |
<?php | |
$catname = wp_title('', false); | |
$new_query = new WP_Query(); | |
$new_query->query('category_name='.$catname.'&showposts=5'.'&paged='.$paged); | |
?> | |
<?php while ($new_query->have_posts()) : $new_query->the_post(); ?> | |
<?php the_title(); ?> | |
<?php } ?> | |
<?php endwhile; ?> | |
<?php next_posts_link('« Older Entries', $new_query->max_num_pages) ?> | |
<?php previous_posts_link('Newer Entries »') ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment