PageNavi not loading beyond page 1
-
My wordpress theme is supposed to be compatible with PageNavi but when I installed the plugin and activated it, it doesn’t work like it should.
My blog is new and has 2 pages of posts. When I click page 2, it just loads the home page (page 1) again.
This is the code located after the posts:
<?php get_sidebar('main'); ?> <?php if(function_exists('wp_pagenavi')) { ?> <div id="navigation" class="pagination pagination-centered"> <?php wp_pagenavi(); ?> </div> <?php } else { ?> <div id="navigation"> <ul class="pager"> <li id="navigation-previous"><?php previous_posts_link(__('« Previous', 'pinclone')) ?></li> <li id="navigation-next"><?php next_posts_link(__('Next »', 'pinclone')) ?></li> </ul> </div> <?php } ?> <div id="scrolltotop"><a href="#"><i class="icon-chevron-up"></i><br /><?php _e('Top', 'pinclone'); ?></a></div> </div> <div class="modal hide" id="post-lightbox" tabindex="-1" role="dialog" aria-hidden="true"></div>
The code for the page is:
<?php get_header(); global $user_ID; ?> <div class="container-fluid"> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; function filter_where( $where = '' ) { $duration = '-' . of_get_option('frontpage_popularity_duration') . ' days'; $where .= " AND post_date > '" . date('Y-m-d', strtotime($duration)) . "'"; return $where; } if (is_home()) { if ('likes' == $popularity = of_get_option('frontpage_popularity')) { add_filter('posts_where', 'filter_where'); $args = array( 'meta_key' => '_Likes Count', 'meta_compare' => '>', 'meta_value' => '0', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'paged' => $paged ); query_posts($args); } else if ($popularity == 'repins') { add_filter('posts_where', 'filter_where'); $args = array( 'meta_key' => '_Repin Count', 'meta_compare' => '>', 'meta_value' => '0', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'paged' => $paged ); query_posts($args); } else if ($popularity == 'comments') { add_filter('posts_where', 'filter_where'); $args = array( 'orderby' => 'comment_count', 'paged' => $paged ); query_posts($args); } else { $args = array( 'paged' => $paged ); query_posts($args); } } get_template_part('index', 'masonry'); get_footer();?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘PageNavi not loading beyond page 1’ is closed to new replies.