-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Use wp_query when the query is set to inherited #41348
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @huubl! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Thanks for the pr @huubl! There are a couple of issues with the At first I'd like to understand what problems you're facing with the current approach. You mention:
current_post is available only during The Loop and the current changes doesn't seem to affect anything. That value is updated later in the loop. Does your PR fixes your use case? If yes, can you elaborate a bit on the use case? What other challenges are you facing? I think the big issue we're having with Query Loop and Maybe we should |
Hi @ntsekouras. Thank you for looking into this.
Yes, this pull request solves my use case. I need to build an irregular layout for posts. I build a custom (ACF) post block and use
I thought I had issues when using the
I agree. A thought: Isn't it possible to alter |
Fixed by: |
@huubl While collecting props and credits for 6.1, it seems you are one of a few dozen folks that have not connected their WordPress.org account to their GitHub profile. Could you share your WordPress.org account so that we can ensure you're properly credited on the About page for WordPress 6.1? Connecting your accounts will also help those collecting this in the future. Thanks in advance! |
What?
Use the actual wp_query when 'inherit query' in the query block is set.
Ps. I think this can't be merged as these lines are there probably for a reason. So maybe it should be fixed an other way.
Why?
When setting 'inherit query' in the query block it's not using the actual wp_query. This gives problems in some cases. For example
current_post
is not inherited and showing as -1.Maybe fixing this too:
#39285
How?
Testing Instructions
Screenshots or screencast
--