[wp-trac] [WordPress Trac] #35365: Pagination is empty since wp 4.4.1
WordPress Trac
noreply at wordpress.org
Fri Jan 8 08:53:17 UTC 2016
#35365: Pagination is empty since wp 4.4.1
--------------------------+-----------------------------
Reporter: BackuPs | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Permalinks | Version: 4.4.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Hi
since wp 4.4.1 get_query_var('page') or get_query_var('paged') returns 0
when permalinks are set to /%category%/%postname%
in a static homepage. It works fine with the static homepage.
It also works fine in wordpress 4.4 and below
$paged will return zero. Please Fix
{{{#!php
<?php
global $wp_version;
if((is_front_page() || is_home() ) &&
version_compare($wp_version, "3.1", '>=')){//fix wordpress 3.1 paged query
$paged = (get_query_var('paged'))
?get_query_var('paged') : ((get_query_var('page')) ? get_query_var('page')
: 1);
}else{
$paged = (get_query_var('paged')) ?
get_query_var('paged') : 1;
}
$query['paged'] = $paged;
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35365>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list