Pagination not working with pagenavi

I added the following to my functions.php file and it worked: function toolset_fix_custom_posts_per_page( $query_string ){ if( is_admin() || ! is_array( $query_string ) ) return $query_string; $post_types_to_fix = array( array( ‘post_type’ => ‘news_article’, ‘posts_per_page’ => 6 ), // add another if you want /* array( ‘post_type’ => ‘movie’, ‘posts_per_page’ => 2 ), */ ); foreach( $post_types_to_fix … Read more

Pagenavi Plugin and Custom Post Type – Multipage results

you are quering the same posts over and over, and that is way you are getting the same posts, to fix it just add ‘paged’ => get_query_var(‘paged’) to your query arguments, so change: <?php $portfolioloop = new WP_Query( array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => 12 ) ); ?> into: <?php $portfolioloop = new WP_Query( array( … Read more

pagination links not displaying

You need to do a little “hack” to get pagination to work for your custom loop. After you define $loop, do the following: <?php // globalize $wp_query global $wp_query; // copy $wp_query into a temporary variable $temp_wp_query = $wp_query; // nullify $wp_query $wp_query = null; // move $loop into $wp_query $wp_query = $loop; ?> At … Read more

Wp PageNavi only works with default permalinks on a custom post type?

Problem solved. It was because I had the Custom Post Type and the Page name the same, “Portfolio” for both. Once I changed this, I went to Settings > Permalinks and flushed. Re-Saved Links. Then checked all the posts links that was using the CPT, and everything went fine after that. I did use the … Read more

Pagination breaks on child-categories, works fine on parent-category

I was finally able to get this working! Here’s how: What I had misunderstood (being a WP noob and all…) is that get_query_var(‘page’) is for pages, and get_query_var(‘paged’) is for posts. http://codex.wordpress.org/Function_Reference/get_query_varfor So I replaced these two lines $paged = (get_query_var(‘page’)) ? get_query_var(‘page’) : 1; // FOR PAGINATION ‘page’ => $paged, // FOR PAGINATION with … Read more