[Résolu] Posts not appearing in alphabetical order
This support ticket is created Il y a 4 années et 7 mois. 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I would like to know here:
I found that you are using few ordering plugins:
- Simple Page Ordering
- WooCommerce Sequential Order Numbers
What if you disable those and change to default theme - Do you see any difference?
Did you try to disable those plugins? As I can see we are displaying the term archive and on one term the order is working and on another its not working, this is strange.
Is it OK for you if I deactivate all non-Toolset plugins on your install?
I've added the following code to "Custom Code" section offered by Toolset:
=> hidden link
add_action( 'pre_get_posts', 'func_change_order_tax_archive');
function func_change_order_tax_archive($query){
if (!is_admin() && $query->is_main_query() and $query->is_tax( 'product_cat')) {
//Set the order ASC or DESC
$query->set( 'order', 'ASC' );
//Set the orderby
$query->set( 'orderby', 'title' );
}
}
Does this mean that the products are hard coded to be listed in alphabetical order now regardless of what is set in the view?
=> yes , this is true but this only applies on Product category archive pages not on all pages.