Comments 28Co-Brains started the conversationJuly 29, 2024 at 2:04pmHi!i'm using your theme on my website and the search searches by posts and pages. i would like the results to be shown in chronological order so that i see the most recent articles last. how can i do this?Thank youhave a nice day 8,859Tahir repliedJuly 29, 2024 at 3:40pmHey Again,Try adding this code snippet via Child Theme functions.php or via a plugin and check: function custom_search_order( $query ) { if ( $query->is_search && !is_admin() ) { $query->set( 'orderby', 'date' ); $query->set( 'order', 'DESC' ); } return $query; } add_filter( 'pre_get_posts', 'custom_search_order' ); Thanks. ThemeNectar Support Team Sign in to reply ...
Hi!
i'm using your theme on my website and the search searches by posts and pages. i would like the results to be shown in chronological order so that i see the most recent articles last. how can i do this?
Thank you
have a nice day
Hey Again,
Try adding this code snippet via Child Theme functions.php or via a plugin and check:
Thanks.
ThemeNectar Support Team