Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Archive Order

Home / Forums / Kadence Theme / Archive Order

This topic is: Resolved
[Resolved]
Posted in: Kadence Theme
February 2, 2021 at 12:09 am

Kadence theme pro: Is it possible to change the order on the archives (blog) to A-Z based on the title rather than when the posts were published? I tried the following snippet but it doesn’t seem to work…

add_action( 'pre_get_posts', 'my_change_sort_order');
function my_change_sort_order($query){
if(is_archive()):
//If you wanted it for the archive of a custom post type use: is_post_type_archive( $post_type )
//Set the order ASC or DESC
$query->set( 'order', 'ASC' );
//Set the orderby
$query->set( 'orderby', 'title' );
endif;
};

I pasted this into code snippets and activated it for front-end. No dice. 🙁

Please help. Thank you.

  • The forum ‘Kadence Theme’ is closed to new topics and replies.