WordPress default gallery pagination when in page (is_page)?
Probably because in your rewrite rule index.php?name=$matches[1]&paged=$matches[2], name is a query var for post slugs – if you want to match pages you need pagename.
Probably because in your rewrite rule index.php?name=$matches[1]&paged=$matches[2], name is a query var for post slugs – if you want to match pages you need pagename.
You’re using $query-> but there is no variable named $query, it’s just pulled out of thin air, it has to come from somewhere, so PHP is generating notices complaining about it. It would be like if I answered the question with “you need to apply gabobobobble” or some other made up word. So instead, look … Read more
Page navi for template page
Hope, the below code is helpful for you to write a custom pagination link. $post_id = $post->ID; // current post ID $args = array( ‘post_type’ => ‘stories’, ‘orderby’ => ‘post_date’, ‘order’ => ‘DESC’ ); $posts = get_posts( $args ); // get IDs of posts retrieved from get_posts $ids = array(); if(isset($posts) && !empty($posts)) { foreach … Read more
Pagination don’t work with active filters
WP_Query, Paginate by Custom Field
As always, at the very moment you give up, the solution comes before your eyes… I was using a static page as the posts page, set up in Settings->reading->page for posts. Removing this has solved the problem. Now I have setup a page-blog.php template, which I have selected as a template for the Blog page … Read more
Thank you both. Meanwhile I got it to work perfect. The way was done with pre_get_posts. My solution now is the function: function numberposts_for_index( $query ) { if( $query->is_main_query() && ! is_admin() && $query->is_home() ) { $query->set( ‘posts_per_page’, ‘4’ ); $query->set(‘post_status’,’future,publish’); }} add_action( ‘pre_get_posts’, ‘numberposts_for_index’ );“` and my code in the index.php now: “`<?php if(have_posts()) … Read more
I was hoping for a nice and clean solution already existing within WordPress, but I didn’t have the time for someone to give it to me, so I created my own pagination routine I put into the functions.php of the theme and call it from the single-auction.php template… function my_pagination($currentID){ $args = array( ‘post_type’ => … Read more
remove rel=next on category page (if <link rel="next" URL is showing 404) it need to remove link from header tag