- This topic has 11 replies, 3 voices, and was last updated 3 years, 4 months ago by
David.
-
AuthorPosts
-
May 9, 2022 at 11:58 pm #2214762
Takeru
I would like to reorder the GB Query Loop in order of the number field of the post meta, and randomly within that number.
Is there a way to do this?May 10, 2022 at 2:47 am #2214924David
StaffCustomer SupportHi there,
menu order was added to the latest alpha release – see here:
https://github.com/tomusborne/generateblocks/issues/429
Randomly – i am not sure how that works with the posts in menu order ?
You can raise an issue on the above github page if you want to suggest any features. Its worth searching the Issues first to see if there are duplicates.Or feel free to reply here 🙂
May 10, 2022 at 3:53 am #2214967Takeru
Thanks David.
I would like to sort the postings in order of the value of the number field and randomly display within the same number.
This will be used for information posting services such as real estate and job postings.
The number field is assigned by contract plan, so the postings with the lowest number in the number field will be displayed at the top, and the postings within the same contract plan will be displayed randomly to maintain fairness.To achieve this, do I need to write some php code after setting the menu order in the GB Query Loop?
May 10, 2022 at 5:07 am #2215031David
StaffCustomer SupportThe number field is assigned by contract plan
Is this a Custom Field ?
May 10, 2022 at 12:38 pm #2215581Takeru
Yes.
May 11, 2022 at 1:56 am #2215992David
StaffCustomer SupportCustom Field query args are something we will be adding to the Pro version in the future.
Orderby Random ill see if that also can be included in the arguments.May 11, 2022 at 2:03 am #2216003Takeru
I understand.
I look forward to it.Thank you.
May 11, 2022 at 2:24 am #2216030David
StaffCustomer SupportYou’re welcome – and thank you for your feedback
November 23, 2022 at 4:09 am #2428796Sascha
“Custom Field query args are something we will be adding to the Pro version in the future.”
is this added already?
November 23, 2022 at 5:32 am #2428918David
StaffCustomer SupportHi there,
no.
If advanced query args are required, you can use the
generateblocks_query_loop_argsfilter.
See for a related example:November 23, 2022 at 5:48 am #2428938Sascha
Thanks, I have added the filter you’ve linked via code-snippets, but it’s not working, check this page.
Any idea whyhow to fix this?
November 23, 2022 at 5:53 am #2428945David
StaffCustomer SupportCan you raise a new topic and explain what it is you want to do, and then we can review if a) thats possible and b) what code is required.
-
AuthorPosts
- You must be logged in to reply to this topic.