Change Number of Custom Post Type Posts per Page

If you are using the Genesis Framework and you want to change the number of custom post type (CPT) posts, that are shown per archive page, you can use the snippet below:

add_filter( 'pre_get_posts', 'change_cpt_per_page' );

function change_cpt_per_page( $query ) {
    if( $query->is_main_query() && $query->is_post_type_archive('my_cpt') ) {
        $query->set( 'posts_per_page', 10 );

If you want to avoid problems in the backend, add !is_admin() && to the if condition.

Notice: You have to change my_cpt to the name of your custom post type type!