Pagination URL in Custom Content Type
Pagination URL in Custom Content Type
Pagination URL in Custom Content Type
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 redirects to 404 when used as archive page
I had the same problem but you just have to put the native loop in category.php which is this: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> then put the function of the plugin: <?php endwhile; wp_pagenavi(); endif; ?> Also check in reading settings, how many posts you want to … Read more
Page navi for template page
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
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
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
Why are you using a category link built with a question mark? If you use the correct permalink which is http://renegadehealth.com/blog/herbs pagination is working fine.
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