• Resolved gorillaagent

    (@gorillaagent)


    My navigation seems top stay on page 1 (page 1 of 2).

    I followed this thread https://scribu.net/wordpress/wp-pagenavi/wpn-2-74.html with no avail.

    Here is my loop, it’s on a custom home page.

    <?php $my_query = new WP_Query( array( 'showposts' => 6, 'orderby' => 'post_date', 'order' => 'DESC', 'paged' => get_query_var('paged') ) ); ?>
    <?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
    
    <div class="post-wrap col-md-6">
    	<div class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
    	<div class="post-meta">By: <?php _e("", "wpbootstrap"); ?> <?php the_author_posts_link(); ?> | <?php _e("Posted", "wpbootstrap"); ?> <time datetime="<?php echo the_time('Y-m-j'); ?>" pubdate><?php the_time(); ?></time></div>
    	<div class="post-inner2">
    		<div class="post-image col-md-5">
    			<?php
    				$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' );
    				$url = $thumb['0'];
    			?>
    			<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?> image"><img src="<?php echo $url ?>" alt="image" /></a>
    		</div>
    		<div class="post-text col-md-7"><small><?php the_excerpt(); ?></small></div>
    		<div class="clearfix"></div>
    		<div class="post-bottom">
    			<div class="post-category col-md-6">
    				<img src="<?php bloginfo('url'); ?>/wp-content/uploads/2014/03/Tags-Flat-icon.png" alt="icon" /> <small>Category: <?php $category = get_the_category(); if($category[0]){
    				echo '<a href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a>'; } ?></span>
    				</small>
    			</div>
    			<div class="col-md-1"></div>
    			<div class="post-comments col-md-5"><small><?php comments_popup_link(__('Leave a comment', 'example'), __('<span class="label label-danger">1</span> Comment', 'example'), __('<span class="label label-danger">%</span> Comments', 'example'), 'comment-btn', __('Comments closed', 'example')); ?> </small></div>
    			<div class="clearfix"></div>
    		</div>
    	</div>
    </div><!--end post-->
        <?php endwhile; ?>
    <div class="pull-right"><?php wp_pagenavi( array( 'query' => $my_query ) ); ?></div>
    <?php wp_reset_query(); ?>

    Any help is much appreciated!

    https://www.ads-software.com/plugins/wp-pagenavi/

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Stays on Page 1’ is closed to new replies.