Core/query-loop help with global $wp-query #62490
Unanswered
TheAggressive
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a dynamic block that I insert into the post template. In it, I call the 'global $wp_query'.
When I run '$wp_query->current_post', I'm getting -1 on all posts which make me think it's happening from outside the loop.
If I toggle the switch to 'inherit query from template' then it properly shows the current_post count.
Kinda confused why this is and also how could I get the proper current_post count without having to toggle the 'inherit query from template' switch?
Thanks for any help!!
Beta Was this translation helpful? Give feedback.
All reactions