Support » Plugin: WP-PageNavi » [Plugin: WP-PageNavi] PageNavi doesn't work at home page !!!

  • Dear PageNavi developer,

    I think this plugin has still a problem. It can’t paginate at home page.
    This is my home page:
    It still show the pagination, but when clicking in any page, it show the 404 error. For example:

    Here is my code in the home.php file:

    <?php get_header(); ?>
    		 		<div class="movies-slider">
    					<ul id="mycarousel" class="jcarousel-skin-tango">
    				    <!-- The content will be dynamically loaded in here -->
    		<div id="movies">
    					<h2 class="page-title">
    							<?php _e( 'New Release', 'bqhmovies' ); ?>
    		  $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    		  $wp_query = new WP_Query(array('post_type' => 'movies',
    			'posts_per_page' => '5',
    			'paged' => $paged)
    		  while ($wp_query->have_posts()) : $wp_query->the_post();
    			 get_template_part( 'content', 'listmovie' );
    		// Reset Query		
    		 wp_pagenavi( array(
    		  'query' => $wp_query
    <?php get_sidebar("movies"); ?>
    <?php get_footer(); ?>

Viewing 1 replies (of 1 total)
  • Moderator keesiemeijer



    Try it without the new WP_Query:
    And with this in your theme’s functions.php:

    function my_post_queries( $query ) {
      // not on admin pages and is the main query
      if (!is_admin() && $query->is_main_query()){
          $query->set('posts_per_page', 5);
          $query->set('post_type', 'movies');
    add_action( 'pre_get_posts', 'my_post_queries' );

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WP-PageNavi] PageNavi doesn't work at home page !!!’ is closed to new replies.