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 Block: perPage being ignored #55317

Open
bradhogan opened this issue Oct 12, 2023 · 3 comments
Open

Query Block: perPage being ignored #55317

bradhogan opened this issue Oct 12, 2023 · 3 comments
Labels
[Block] Query Loop Affects the Query Loop Block Needs Testing Needs further testing to be confirmed. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Bug An existing feature does not function as intended

Comments

@bradhogan
Copy link

Description

When using a query block on a single template (i.e. to show more articles for a user to browse), the query "perPage" parameter is not working properly. This happens with the default theme and only Gutenberg active.

Step-by-step reproduction instructions

  1. Make sure you have 5 or more posts
  2. In the site editor, edit the single template
  3. At the bottom of the single template in the site editor, add a query block
  4. Set the query block to show 3 per page, do NOT inherit query from existing template
  5. Save the template, view one of your posts in the front-end
  6. Notice that the query block at the bottom shows more than just the 3 articles

Screenshots, screen recording, code snippet

No response

Environment info

  • wp 6.3.1
  • gutenberg 16.8.0
  • chrome
  • mac

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

@jordesign jordesign added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. [Block] Query Loop Affects the Query Loop Block labels Oct 12, 2023
Copy link

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Nov 12, 2023
@4hiroramos
Copy link

Hi, thank you for your issue.
I've tried it, and I see why you mentioned it as a problem.
However, that didn't matter at all.
I think this is a different problem.

  • WordPress 6.6
  • PHP 8.0
  • Gutenberg 18.8.0

@tbshiki
Copy link

tbshiki commented Jul 21, 2024

Hi,
I tried to see if the same situation would occur.
Environment tested:

  • WordPress Version: 6.6
  • Gutenberg Version: 18.8.0
  • Windows
  • Google Chrome: 126.0.6478.127 (Official Build) (64-bit)

This was in an environment with more than 5 posts created.
I added a Query Loop block and set ITEMS PER PAGE to 3 without selecting a template.
When set to 3, only 3 posts were displayed, and when set to 4, only 4 posts were displayed.
I believe this behavior is correct.
I'm not certain, but is it possible that STICKY POSTS are affecting this?
When I set STICKY POSTS to Exclude, the sticky posts were not displayed, and the number of posts shown matched the specified display count.
I think this behavior is also as expected.
Thank you.

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 Needs Testing Needs further testing to be confirmed. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants