Комментарии:
Exactly the type of video tutorial I was looking for as a new Oxygen Builder user! Thank you! I am also just starting your courses.
Just a thought: would the order field have been better as a "Range" field type? By using actual numerical values it may sort better than using text fields to represent a numerical value.
You defined the field as text. If you order by value it will be ordered by text value. That’s the reason 7 is before 60. Use type number to get the correct order. The numbers you have to use are 60 for Ariana and 10 for Anna. Or set your order by descending / ascending.
ОтветитьHi Jonathan, great tutorial again. I think the ordering issues you had when you changed the number of digits etc is probably because you are using a text field instead of a number field for order value. If you changed it to a number field, it would hopefully work properly. Cheers
ОтветитьThanks so much for the video. I thought this was going to be directed at a current problem I have. Sadly it was not.
How would you sort by a custom field, like start date for events, for archives using the default query that would cover categories, tags etc
This is way over engineered. The plugin called post type order is much more user friendly than this approach. Clients love it.
ОтветитьI really want to thank you man 😊 you're solved my problem that I was days trying to solve it 👌 I really thank you. Keep going 😉
ОтветитьHello, thenk you, I wonder if the date orders well?
ОтветитьTo resolve the issue of what value should be in the ordering, you can use basic numbering from 1 to N. The problem is in the query not repeater. To fix the issue use the following:
post_type=NAMEOFPOSTTYPE&meta_key=CUSTOMFIELDNAME&orderby=meta_value_num&order=ASC
You have used meta_value that treats numbers as normal characters and not a numeric value. Use meta_value_num to treat numbers as numbers and use order parameter to sort it either ASC = ASCENDING or DESC = DESCENDING.
I hope this helps :)
I have a CPT with taxonomy/archive template and have 100+ taxonomy, I use the 'Default' repeater query and the post shows from the respective categories only. But I want to use this custom field order, can you tell me what is the manual query for pulling the posts from current taxonomy(like how the default query works)?
Ответитьyou need to use orderby=meta_value_num&order=ASC or DESC and you wont have a problem with single double or triple digits, it will order it by the numerical value.
Ответить