wp order archive page post by title

You can achieve this by adding the following code to your theme's functions.php file or in a custom plugin:

function custom_order_archive_posts( $query ) {
    if ( $query->is_archive() && $query->is_main_query() ) {
        $query->set( 'orderby', 'title' );
        $query->set( 'order', 'ASC' );
    }
}
add_action( 'pre_get_posts', 'custom_order_archive_posts' );

This code creates a custom function called custom_order_archive_posts, which modifies the main query used to display the archive page. It checks if the query is for an archive page and if it's the main query, then it sets the order of the posts by title in ascending order (ASC).

After adding this code, the archive page will display the posts ordered by title.