WordPress.org

Forums

[Plugin: WP PageNavi] 1st page keeps reloading (2 posts)

  1. INchargeWebsite
    Member
    Posted 1 year ago #

    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(__('&laquo; Previous', 'pinclone')) ?></li>
    			<li id="navigation-next"><?php next_posts_link(__('Next &raquo;', '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>
  2. INchargeWebsite
    Member
    Posted 1 year ago #

    After reviewing the code more, it appears the problem is coming from this block of code

    <?php get_header(); ?>
    <div class="container-fluid">
    	<?php
    	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    	$args = array(
    		'post_type' => 'post',
    		'paged' => $paged
    	);
    
    	query_posts($args);
    
    	get_template_part('index', 'masonry');
    	get_footer();?>

Topic Closed

This topic has been closed to new replies.

About this Topic