New answers tagged pagination
3
After struggling for hours on this (and 6 years after the question was asked), for me the solution was lying within the $paged parameter:
I changed
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
to
if ( get_query_var('paged') ) {
$paged = get_query_var('paged');
} else if ( get_query_var('page') ) {
$paged = get_query_var('...
0
I managed to achieve this by disabling canonical redirection for pagination queryies like so...
add_filter( 'redirect_canonical', function ( $redirect_url ) {
if ( is_paged() ) {
return false;
}
return $redirect_url;
}, 10, 1 );
This should get you...
http://www.example.com/category_name/?paged=2
Note, this used paged instead of page as this is ...
0
I would add this as a comment but cant right now.
Im not seeing <?php get_search_form(); ?>
Also, your code is not complete...you are showing a closing section tag but not the opening one. Also, you are searching page/2, this looks like a menu item. If this exact wording is not in the content area, then Im pretty sure you will not see any results. Go ...
1
function noindex_comments_pages()
{
global $cpage;
if (!empty($cpage) && $cpage > 1) {
echo '<meta name="robots" content="noindex">';
echo "\n";
}
}
add_action( 'wp_head', 'noindex_comments_pages', 9 );
comments pagination robots.txt noindex paginate-comments-links
0
<?php
$paged;
if ($paged == 0){
$paged++;
} ?>
You can add some code to set the variable as 1 if it is 0.
0
It looks like you could just comment out the pagination function - but we can't see what that actually does, so this is a guess:
// goblog_free_pagination_default();
1
Making your Custom Pagination design In Demo According Your Need .
below function Replace Your Function:
function wp_custom_pagination($args = [], $class = 'pagination') {
if ($GLOBALS['wp_query']->max_num_pages <= 1) return;
$args = wp_parse_args( $args, [
'mid_size' => 2,
'prev_next' => false,...
Top 50 recent answers are included
Related Tags
pagination × 1725wp-query × 336
custom-post-types × 271
loop × 202
posts × 125
php × 112
categories × 93
paginate-links × 83
custom-taxonomy × 67
query × 65
customization × 63
query-posts × 61
permalinks × 57
404-error × 56
functions × 55
search × 55
pages × 54
archives × 51
ajax × 49
url-rewriting × 44
theme-development × 41
rewrite-rules × 39
navigation × 38
plugins × 35
comments × 34