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

Query loop ignores items per page setting for sticky posts #64083

Open
2 tasks done
alaczek opened this issue Jul 30, 2024 · 2 comments
Open
2 tasks done

Query loop ignores items per page setting for sticky posts #64083

alaczek opened this issue Jul 30, 2024 · 2 comments
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Bug An existing feature does not function as intended

Comments

@alaczek
Copy link

alaczek commented Jul 30, 2024

Description

The query loop block displays all sticky posts, regardless of "Items per page"settings.

Step-by-step reproduction instructions

  1. Add four posts to a site, make two of them sticky.
  2. Add two query loop blocks to a front page or home template.
  3. Configure the first query loop:
  • items per page: 1
  • offset: 0
  • max pages to show: 1
  • inherit query from template: disabled
  • sticky posts: include
  1. Configure the second query loop:
  • items per page: 1
  • offset: 1
  • max pages to show: 1
  • inherit query from template: disabled
  • sticky posts: include
  1. Notice the editor shows the right posts/number of posts.
  2. Save and preview the site. Both loops will display the two sticky posts.

I expected both query loops to display one post only, and it seems they both show all the sticky posts instead.
I'm wondering if this is the expected behavior of sticky posts in a query loop, because excluding sticky posts does fix the issue. If this is expected, how can we clarify that "Items per page" setting doesn't apply to sticky posts?

Screenshots, screen recording, code snippet

Query 1 settings:
image

Query 2 settings:
image

Blog posts on the site:
image

Preview:
image

Environment info

  • WordPress: 6.6.1
  • Gutenberg: 18.8
  • Theme: tested with TT4, and Assembler themes.

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@alaczek alaczek added the [Type] Bug An existing feature does not function as intended label Jul 30, 2024
@dsas dsas added the [Block] Query Loop Affects the Query Loop Block label Jul 30, 2024
@carolinan
Copy link
Contributor

I believe these are duplicates? #55317

@carolinan
Copy link
Contributor

@rw-ye Because this repository is public and welcomes contributions, please provide context since it may not be clear to contributors outside of your organization what "Reported in: zd-9100710" refers to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants