I have this custom code for Toolset in which I make all views and product archives ordered by price (from min to max).
<?php
/**
* New custom code snippet.
*/
toolset_snippet_security_check() or die( 'Direct access is not allowed' );
function sort_by_regular_price($query) {
if ( $query->is_post_type_archive('product') or $query->is_tax('product_cat') ) {
$query->set('order', 'ASC');
$query->set('meta_key', '_regular_price');
$query->set('orderby', 'meta_value_num');
}
}
add_action('pre_get_posts', 'sort_by_regular_price');
I need one view by id: 6217 to be set order by post date descending (from newset to oldest). Is there a chance you can do it by creating some kind of IF statement in that code section above?
Do you need further assistance here? If yes: please share access details so I can review your setup and guide you in the right direction.
*** 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.