Taxonomy page lead to 404 page on pagination
Taxonomy page lead to 404 page on pagination
Taxonomy page lead to 404 page on pagination
look for the string page/ and capture just the part of the url before it with strpos and substr: $url=”/players/type/pros/page/3/”; $find = ‘page/’; $trimmed_url = substr( $url, 0, strpos($url, $find) ); EDIT – so in the context of your question you could use: $url = $_SERVER[‘REQUEST_URI’]; $find = ‘page/’; $pos = strpos($url, $find); if($pos): $url … Read more
Pagination does not work well will with secondary queries. First, the ordinary pagination functions depend upon the main query in the global variable $wp_query. They won’t work with secondary queries. There are already a number of questions here about that if you search the site. Second, trying to paginate secondary queries tends to result in … Read more
I think the easiest implementation would be to put your infinite scroll in category.php, and then, either using Dashboard -> Settings -> Reading -> Posts per page, or via direct query modification, display one post per page. Otherwise, depending on how you’re implementing the infinite scroll, you could make use of next_post_link() and previous_post_link(), both … Read more
My recommendation would be to use a separate query for each column – getting 1 post per category – and pass the global $paged variable into each. This should exhibit the behavior you described in your question (at least it does on my site). My setup I have a top section that displays the 5 … Read more
Well, modifying this codilight_lite_custom_paginate() function is not a good option. Cause if it gets modified then it might cause problem on other pages. So if you want to paginate your archive.php child category foreach loop then remove the codilight_lite_custom_paginate() function and customize your archive.php page like below – <?php /** * Category Template: Custom */ … Read more
get_query_var(‘paged’) giving same result
For the record, I just found a new/different way to accomplish this goal. It’s not quite the same, but it does allow me to insert a new post type after every X posts in my original loop. This is the source: https://www.gowp.com/blog/inserting-custom-posts-loop/ The method was done via the code below, which essentially injects a new … Read more
Your $paged variable on the first is set in the main query. And there is just one page, because it is a page. The get_posts() calls don’t affect that. So the number of all available pages is never higher than the current page, and you cannot get a next page link. Solution: filter pre_get_posts and … Read more
The plugin author has confirmed on the WordPress Support Forums that posts_per_page only works if the type is set to scroll and not click, see http://wordpress.org/support/topic/posts_per_page-not-having-any-effect?replies=5#post-5058675