- This topic has 28 replies, 3 voices, and was last updated 3 years, 2 months ago by
Alessandro.
-
AuthorPosts
-
August 3, 2022 at 6:00 pm #2302618
Fernando Customer Support
In your site, where can we specifically find the Query loop block?
August 3, 2022 at 6:00 pm #2302619Alessandro
There’s one on the About page and on the Homepage (same block)
August 3, 2022 at 6:10 pm #2302623Fernando Customer Support
To clarify, by “it” not working, do you mean that the Query isn’t ordering as expected, or are you referring to it still appearing “no results found” in the editor?
August 3, 2022 at 6:11 pm #2302624Alessandro
Sorry, I meant the “No results found” error. The query itself has always worked fine, it’s just not editable in Gutenberg unless I temporarily change the sorting to some other method than “menu order”. Not a huge problem.
August 3, 2022 at 6:17 pm #2302629Fernando Customer Support
That’s odd, I tried viewing the edit page from my end, and I couldn’t replicate the issue. The Query loop block is showing results.
Can you try viewing from a different browser or device? Might be a cache/device issue or a WordPress glitch.
August 3, 2022 at 6:19 pm #2302631Alessandro
I had removed Menu Order just now (for testing). I added it back – you can see the problem persists. It’s OK if we can’t resolve this, I thought I was missing something obvious but I understand the PHP function is not standard.
August 3, 2022 at 6:25 pm #2302635Fernando Customer Support
I see. As Ying mentioned, “As menu order is for pages usually, even we use the code to add it to the posts editor in admin, but the function that generates the preview of GB query loop doesn’t know.”
Using the function I provided is an alternative if you want the order setting, and still see the posts in the editor.
August 3, 2022 at 6:26 pm #2302637Alessandro
The provided function still causes the same problem though. It’s currently active on the dev site.
August 3, 2022 at 6:35 pm #2302648Ying
StaffCustomer SupportYou need to remove the
order by
parameter from the query loop blocks.And I’m not seeing the class has been added to the query loop block, nor the function that Fernando provided in your child theme.
August 3, 2022 at 6:37 pm #2302649Alessandro
If I do that the blocks become visible in Gutenberg, but the ordering does not work correctly. Maybe I added that CSS class incorrectly?
Edit:
And I’m not seeing the class has been added to the query loop block, nor the function that Fernando provided in your child theme.
It is there.
August 3, 2022 at 6:49 pm #2302654Ying
StaffCustomer SupportIf I do that the blocks become visible in Gutenberg, but the ordering does not work correctly
I was checking the home page, it seems you’ve added the class to the about page.
Is this the correct order?
https://www.screencast.com/t/3CGLgjh4August 4, 2022 at 4:43 am #2303083Alessandro
Oh yes sorry, it was indeed the About page. And no, the order is not working. Stacey should be last in the list.
August 4, 2022 at 9:57 am #2303453Ying
StaffCustomer SupportHum, I’m not seeing Fernando’s code, it seems you are still using the original code:
https://www.screencast.com/t/Vmbz2k1C2hAugust 4, 2022 at 9:59 am #2303455Alessandro
Oops, I must have reverted back to the previous function… it is working now! Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.