I am trying to:
Get categories to display using [wpv-control-post-taxonomy] based on their hierarchical order that is specified in the Admin dashboard. I spent a lot of time rearrange categories hierarchically and in the correct order i want them to display.
yet there is no "Order by..." field that allows you to order by hierarchy or "order by value" or anything appropriately named.
Link to a page where the issue can be seen:
hidden link
I expected to see:
The top level categories should be:
BED
BATH
SLEEPWEAR
TABLE
ETC
See the attached image.
Instead, I got:
You can see what i got at the page.
Hello,
Are you using classic editor to setup the Views WordPress archive?
If it is, you can follow our document to add the orderby attribute in shortcode wpv-control-post-taxonomy:
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-control-post-taxonomy
This attribute is based on WordPress built-in feature:
https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
'orderby'
(string) Field(s) to order terms by.
Here is my code:
[wpv-control-post-taxonomy taxonomy="product_cat" type="checkboxes" orderby="orderby" url_param="wpv-product_cat" output="legacy"]
i set the orderby to "orderby" like you suggested. The only options per this documentation are:
'name' (default) | 'count' | 'id' | 'none' | 'slug' | 'term_group'
Which doesn't make sense. Why are none of the options the hierarchy order that you can set by clicking and dragging the categories around?
Please see my image i attached previously to show the hierarchy.
here is the page that is INCORRECTLY displaying.
hidden link
There isn't such kind of built-in feature for "clicking and dragging the categories around", in your case you can try to modify the shortcodes as below:
[wpv-control-post-taxonomy taxonomy="product_cat" type="checkboxes" orderby="id" url_param="wpv-product_cat" output="legacy"]
And test again.
The feature is built into WordPress. So you're saying Toolset never supported this feature which is native to WordPress?
Order by "id" does not accomplish what I need to do. How can I modify the code then so it will order by something else?
The "clicking and dragging the categories around" feature is not a WordPress built-in feature, that is a feature of Woocommerce plugin.
I have tried it in my localhost with a fresh WordPress installation, for example:
Dashboard-> Posts-> Categories, I don't see any built-in feature for "clicking and dragging the categories around".
Can you confirm it?
For the question:
How can I modify the code then so it will order by something else?
No, there isn't such kind of built-in feature within Toolset Views plugin, the only availiable option is I mentioned above: "orderby".
You can add a feature request for it, our developers will evaluate it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/