Instead, I got:Attached images show the problem. I’m using plugin “Custom Taxonomy Order NE” and it is working fine on the post admin of a CPT, but not displaying properly on the post.
I have set the term to non-hierarchical, but that doesn’t help. I’m pretty sure I have exhausted all efforts to see what might not be working with the plugin. One things, drag and drop does not work on the Taxonomy Order screen of the plugin.
Can you help me with a function just to change the order of the terms as shown in the admin screen I’ve added to this ticket? It would be great if I could just skip the plugin altogether.
"It would be great if I could just skip the plugin altogether."
Unfortunately, WordPress doesn't come with any way to custom order terms. Views queries make available the built-in WordPress options (e.g. by term_id, term name etc.).
For anything else you are going to need custom functionality.
The easiest way to add that is with an existing plugin.
(It is not so popular, but is from a core contributor and I trust it.)
It makes an orderby "order" option available in queries, which is to say the custom order you set on the taxonomy edit screens using drag and drop.
You still need to modify your View taxonomy queries where you are outputting the terms, but that is fairly straightforward with some code such as this:
function tssupp_custom_term_order($view_args, $view_settings, $view_id)
{
if (in_array($view_id, array( 123 ))) { // Add as many View IDs as you need as a comma-separated list
$view_args['orderby'] = 'order';
$view_args['order'] = 'ASC';
}
return $view_args;
}
add_filter('wpv_filter_taxonomy_query', 'tssupp_custom_term_order', 101, 3);
I tested to check there are no issues with the drag and drop etc. with current Toolset versions and it seems to work fine.
That plugin hasn't been updated in a year and doesn't show up in my admin after activation . I did get < part >of "Custom Taxonomy Order" (https://wordpress.org/plugins/custom-taxonomy-order-ne/) to work; it sorts the terms in the post box (img-1), but it doesn't show on the post (img-2).
In any case, I don't understand "modify View taxonomy queries where you are outputting the terms." What View, darling? I am so horribly frustrated by this. (See img-3, AHEM.)
Nigel is away on vacation until tomorrow, so I'll be following up on this.
The shortcode [wpv-post-taxonomy] only supports showing the attached taxonomy terms in ascending or descending order ( ref: https://toolset.com/documentation/user-guides/views-shortcodes/#vf-153472 ), which is why the custom order that you've set in the admin area using the third-party plugin is not applying to the post's front-end.
In case you need personalized assistance around custom code, you can consider hiring a professional from our list of recommended contractors: https://toolset.com/contractors/
I hope this helps and please let me know if you need any further assistance around this.
Any custom ordering is not going to work when outputting the terms with the wpv-post-taxonomy shortcode.
The only solution I can suggest is to create a View to output the terms instead of using the wpv-post-taxonomy shortcode, in combination with the WP Term Order plugin and the wpv_filter_taxonomy_query to use the 'order' option provided by that plugin.
(There are no settings screens for the plugin, you just activate it and drag and drop the taxonomy terms into the order you require.)