Skip Navigation

[Resolved] Split: taxonomy archive sorting not working

This support ticket is created 3 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by jesseH-3 3 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1894543

I'm sorry, I just noticed that this issue is also affecting my other category archive as well.
Example: /line-card/commercial-industrial/
The rows should appear in ascending order by post title. I'm not sure what order is being shown currently.
Can you help? The login info provided should still work.
Thanks!

#1894545

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

When you mark ticket as resolved, the private information you share (access details) is automatically removed.

Can you please share access details and tell me what should be the order (asc or desc) and what should be the orderby (date, menu_order) should be applied for your line-card archive?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1895839

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: /line-card/commercial-industrial/

I've adjusted the pre_get_posts hook code added to "Custom Code" section as given under:

add_action( 'pre_get_posts', 'func_sort_tax_archive_menu_order',999);
function func_sort_tax_archive_menu_order($query) {
    if ( !is_admin() && $query->is_main_query() and $query->is_tax('team-group') ) {
     	$query->set('orderby', 'menu_order');   
        $query->set('order', 'ASC');        
    }
  	if ( !is_admin() && $query->is_main_query() and $query->is_tax('line-card') ) {
     	$query->set('orderby', 'title');   
        $query->set('order', 'ASC');        
    }
    return $query;
}

I can see it works as expected - Can you please confirm it works at your end as well.

#1896359

Thanks so much for your help, looks good.