Skip Navigation

[Resolved] Using wpv-control-post-taxonomy some terms do not respect order setting

This thread is resolved. Here is a description of the problem and solution.

Problem:
A checkbox taxonomy is output using the wpv-control-post-taxonomy shortcode, but some of the terms don't respect the specified order.

Solution:
Changes had been made to the taxonomy which meant some terms had a parent term setting that was no longer relevant. Changing these to zero fixed the issue.

This support ticket is created 6 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by Todd 6 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#605303
toolsetthing.png

I am trying to: order the appearance of checkboxes in a custom search form made using views in the filter editor section. There are 16 taxonomies displayed, and 2 appear at the end out of order. I tried specifying order & orderby attributes but that did not help. When switching from ASC to DESC these remain at bottom but the other items will switch order as expected

Link to a page where the issue can be seen: hidden link

The specific line that I think is relevant:

[wpv-control-post-taxonomy taxonomy="thigh-fit-type" order='ASC' orderby='name' type="checkboxes" url_param="wpv-thigh-fit-type"] 

The whole code is:

[wpv-filter-start hide="false"]
[wpv-filter-controls]

<div class="container">
  <div class="row">
          <div class="col-sm-4">
            <div class="row">                          

              
<div class="form-group">
	<label>[wpml-string context="wpv-views"]Butt (or Seat) Fit Options[/wpml-string]</label>
	[wpv-control-post-taxonomy taxonomy="possible-jean-fit-type" type="checkboxes" url_param="wpv-possible-jean-fit-type" order="ASC" orderby="name"]
</div>              
              
             </div>
            </div>

  
    
          <div class="col-sm-4">
            <div class="row">     
              
<div class="form-group">
	<label>[wpml-string context="wpv-views"]Thigh Fit Options[/wpml-string]</label>
	[wpv-control-post-taxonomy taxonomy="thigh-fit-type" order='ASC' orderby='name' type="checkboxes" url_param="wpv-thigh-fit-type"]
</div>            
              
          </div>
    </div>
  </div>
</div>
                                                                                                 
<div class="form-group col-xs-6">
	<label>[wpml-string context="wpv-views"]Leg Types[/wpml-string]</label>
	[wpv-control-post-taxonomy taxonomy="csf_leg_type" type="checkboxes" url_param="wpv-csf_leg_type"]
</div>

<div class="container">
  <div class="row">
    <div class="col-sm-8">
    [wpv-filter-submit output="bootstrap"]

    [wpv-filter-spinner spinner="<em><u>hidden link</u></em>"][/wpv-filter-spinner]

    [wpv-filter-reset output="bootstrap"]
    </div>
  </div>
</div>   
<p>
  
<div><strong>Showing [wpv-found-count] jeans.</strong></div>

[/wpv-filter-controls]
[wpv-filter-end]
#605335

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Todd

I can see the issue on your site, but when testing this locally it works as expected.

I think I'll need a copy of your site to be able to investigate why it is happening with you.

https://toolset.com/faq/provide-supporters-copy-site/

If you are not familiar with creating a duplicate, I can take it myself with the site credentials. You may want to create an admin user for me that you can later delete.

Your next reply is private.

#605551

Hi Nigel, thanks for the reply.

I found the issue! Those terms had a parent assigned in the 'wp_term_taxonomy' table that we had started with but no longer using. I simply changed the 'parent' for those terms to 0 and they fell in line.

I know the person who was initially doing the tagging started with some general parent categories like "Tight Fit" with the hopes that a user could first select a parent like "Tight Fit" or "Loose Fit" and then in the next selection it would filter to "Average Thigh", "Small Thigh" etc. The idea was a cleaner UX without 16 terms. She messed around a bit with parents and such and the issue is probably a unique situation created there.

Unfortunately the scope of this functionality is well beyond my (junior but learning!) capabilities so we settled on a flat (if somewhat non-ideal) approach with all pairs.

Cheers