[wp-trac] [WordPress Trac] #35344: Strange pagination issue on front page after 4.4.1 update
WordPress Trac
noreply at wordpress.org
Tue Jan 12 12:30:01 UTC 2016
#35344: Strange pagination issue on front page after 4.4.1 update
-------------------------------------------------+-------------------------
Reporter: northeme | Owner: dd32
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.4.2
Component: Canonical | Version: 4.4.1
Severity: normal | Resolution: worksforme
Keywords: has-patch needs-unit-tests needs- | Focuses:
testing |
-------------------------------------------------+-------------------------
Changes (by nikkoboy):
* status: reopened => closed
* resolution: => worksforme
Comment:
Replying to [comment:16 BackuPs]: Changing the wp-includes/canonical.php
lines 264-270 worked perfectly for me! I'm running WT Tera News on my
blog, and I had this pagination issue. Deactivated all plugins at first
(pagination problems have been often linked in my case, to the cache
plugin I use or the Easy Digital Download plugin).
Thanks to this workaround in the canonical.php file, pagination is back on
the homepage.
Thank you for sharing!
> I can confirm changing the wp-includes/canonical.php lines 264-270 from
this
>
> {{{#!php
> <?php
> // Post Paging
> if ( is_singular() && ! is_front_page() &&
get_query_var('page') ) {
> if ( !$redirect_url )
> $redirect_url = get_permalink(
get_queried_object_id() );
> $redirect_url = trailingslashit( $redirect_url ) .
user_trailingslashit( get_query_var( 'page' ), 'single_paged' );
> $redirect['query'] = remove_query_arg( 'page',
$redirect['query'] );
> }
> }}}
>
>
> to
>
> {{{#!php
> <?php
> // Post Paging
> if ( is_singular() && get_query_var('page') && (
!is_front_page() || ( isset($wp_query->queried_object) && 'page' ==
get_option('show_on_front') && $wp_query->queried_object->ID ==
get_option('page_on_front') ) ) ) {
> if ( !$redirect_url )
> $redirect_url =
get_permalink( get_queried_object_id() );
> $page = get_query_var( 'page' );
> if ( is_front_page() ) {
> $redirect_url =
trailingslashit( $redirect_url ) . user_trailingslashit(
"$wp_rewrite->pagination_base/$page", 'paged' );
> } else {
> $redirect_url =
trailingslashit( $redirect_url ) . user_trailingslashit( $page,
'single_paged' );
> }
> $redirect['query'] = remove_query_arg(
'page', $redirect['query'] );
> }
> }}}
>
> fixes the issue.
>
> I guess this will be part of the next update?
>
> Thank you.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35344#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list