Skip Navigation

[Resolved] wpv-control-post-taxonomy does not show based on hierarchical order

This support ticket is created 4 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 4 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#1545139
Screen Shot 2020-03-09 at 9.57.15 PM.png

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.

#1545401

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.

#1546071

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

#1546355

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.

#1554809

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?

#1555727

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/