[wp-trac] [WordPress Trac] #49773: Navigating through list of posts on single.php is not functioning
WordPress Trac
noreply at wordpress.org
Thu Apr 2 02:44:45 UTC 2020
#49773: Navigating through list of posts on single.php is not functioning
-------------------------------------------------+-------------------------
Reporter: 1BJK903 | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: Posts, Post Types | Version: trunk
Severity: major | Resolution:
Keywords: needs-testing 2nd-opinion reporter- | Focuses: template
feedback |
-------------------------------------------------+-------------------------
Changes (by SergeyBiryukov):
* keywords: needs-testing needs-patch 2nd-opinion needs-dev-note => needs-
testing 2nd-opinion reporter-feedback
* focuses: ui, accessibility, template => template
Comment:
Hi there, welcome to WordPress Trac! Thanks for the report.
> Instead of taking the page-slug/page/#/, it should take the post-slug/#/
when using the pagination in single.php.
Just to clarify, these are not the same thing:
* `/page/#/` corresponds to the `paged` query variable that is used for
various archives.
* `/#/` corresponds to the `page` query variable that is used for post
content separated with [https://wordpress.org/support/article/faq-
troubleshooting-2/#i-used-the-quicktag-nextpage-in-a-post-so-why-doesnt-
it-work <!--nextpage--> tag] in combination with
[https://developer.wordpress.org/reference/functions/wp_link_pages/
wp_link_pages()] in single post template.
I know this might be confusing.
> Another example:
>
> {{{#!php
> <?php
> <?php
> // wp query
> $wp_query = new WP_Query( array( 'posts_per_page' => 25,
> 'paged'
=> $paged,
> )
);
> $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
> ...
> }}}
You're using the `$paged` variable before it's defined. You should define
it before `$wp_query`, not after.
So far, I'm having trouble reproducing the issues. Сould you provide the
steps to reproduce the issue on a clean install?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49773#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list