Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prev/Next links include the slug twice when using Query Loop block on non-homepage content #21354

Open
3 tasks done
amboutwe opened this issue May 1, 2024 · 0 comments
Open
3 tasks done

Comments

@amboutwe
Copy link
Member

amboutwe commented May 1, 2024

  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened

When a non-homepage contains a Query Loop block, the prev and next URLs include the slug twice. A previous fix for a similar issue. Pages can also be nested so that should be taken that into account as well.

Workaround

No known workaround.

To Reproduce

Step-by-step reproduction instructions

Starting with a vanilla installation:

  1. Create or import theme unit test content.
  2. Go to Admin > Pages > Add New Page
  3. Add Page title
  4. Add Query Loop block
  5. Click 'Start blank'
  6. Click 'Title & Date'
  7. Publish and view the page
  8. See the pagination links and they link to each page correctly
  9. Install and activate Yoast SEO (free)
  10. View the page again
  11. See the pagination links and they link to each page correctly
  12. View the source code
  13. See the next URL contains the slug twice
  14. Check page 2's source code and see the slug twice for prev and next

Expected results

https://example.com/query-loop-block-test/?query-0-page=2

Actual results

https://example.com/query-loop-block-test/query-loop-block-test/?query-0-page=2

Screenshots, screen recording, code snippet

Page is NOT static front page
screenshot_190

Page IS static front page
screenshot_192

Technical info

  • If relevant, which editor is affected (or editors):
  • Block Editor

Used versions

  • Device you are using: Desktop
  • Operating system: Win 11
  • PHP version: 8.0.30 (Supports 64bit values)
  • WordPress version: 6.5.2
  • WordPress Theme: Twenty Twenty-Three (twentytwentythree)
  • Yoast SEO version: 22.6 (also tested 22.1 and 22.7 RC 1 but issue happens in those too)
  • Relevant plugins in case of a bug: N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants