Please add this code in your theme’s functions.php at the end
add_action('pre_get_posts', 'custom_scproder_desc', 90 );
function custom_scproder_desc( $wp_query ){
if ( is_admin() ){
return;
}
$scporder_options = get_option('scporder_options') ? get_option('scporder_options') : array();
$objects = isset($scporder_options['objects']) && is_array($scporder_options['objects']) ? $scporder_options['objects'] : array();
if ( isset( $wp_query->query['post_type'] ) ) {
if ( ! is_array( $wp_query->query['post_type'] ) ) {
if ( in_array( $wp_query->query['post_type'], $objects ) ) {
$wp_query->set('order', 'DESC');
}
}
}else {
if (in_array('post', $objects)) {
$wp_query->set('order', 'DESC');
}
}
}
This will do it!
Warmly,
Mihaela