-
savacations
I have been replacing WPSP grids on my site with Query Loops. One thing that I liked about WPSP is that with a short code you could specify the order of posts/pages by id. So far, the ASC and DESC sorting order has worked for me, but I am now looking to customize the order of the posts like in WPSP. This is for hotels which I want to display by level from 3 star all the way to deluxe.
Any suggestions for a non-developer?
-
Hi there,
You can create a custom field for the posts, for example, a score from 0 to 10.
Then you can order the query loop using this custom field’s value:
https://docs.generateblocks.com/article/order-query-loop-by-custom-field/ -
savacations
Creating a custom field is not non-developer friendly.
I figured things out by adding the parameter of “menu order” to the query loop and adding a menu order number for each page that I want to sort in pages/quick edit. Do you see any reasons to not do it this way?
When either Word Press or Generate Press get updated, will I lose the number that I input in menu order or will these items be saved?
Please let me know.
Thanks,
-
Do you see any reasons to not do it this way?
Pages have menu order, but not posts. As you asked about both posts and pages 🙂
But yes, you can use PHP code or plugin to enable menu order for posts as well, which is not non-developer friendly as well…
When either Word Press or Generate Press get updated, will I lose the number that I input in menu order or will these items be saved?
No, that’s a WP option, theme does not interfere with that.
-
savacations
OK. Thanks,
-
No Problem 🙂
- You must be logged in to reply to this topic.