Help with CPT template pagination

i created a themes CPT using the following code

function pp_themes_post_type() {
    $args = array(
        'public'       => true,
        'label'        => 'ProfilePress Themes',
        'has_archive'  => true,
        'hierarchical' => true,
        'supports'     => array( 'title', 'editor', 'page-attributes', 'revisions', 'thumbnail' ),
        'taxonomies'   => array( 'category', 'post_tag' )
    );
    register_post_type( 'themes', $args );
}

add_action( 'init', 'pp_themes_post_type' );

I then created a archive-themes.php template file containing the following code that displays Easy digital downloads products categorized as theme.

$paged = get_query_var( 'paged', 1 );


$args = array(
    'post_type'      => 'download',
    'offset'         => 0,
    'paged'          => $paged,
    'posts_per_page' => $posts_per_page,
    'tax_query'      => array(
        array(
            'taxonomy' => 'download_category',
            'field'    => 'slug',
            'terms'    => 'theme' //if field is ID you can reference by cat/term number
        )
    ),
);

$wp_query = new WP_Query( $args );

Viewing the themes CPT output the edd products categorized as theme (see http://profilepress.net/themes/)

The problem arise when you try to goto the next page which 404. (see http://profilepress.net/themes/page/2
)
I installed What Template File Am I Viewing? plugin and discovered the archive-themes.php template isn’t used when viewing page 2.

I need all the help i can.

Solutions Collecting From Web of "Help with CPT template pagination"

there is no need to handle the pagination like this:

$paged = get_query_var( 'paged', 1 );

Just put this after the loop:

get_the_posts_pagination(
    'mid_size'              => 1,
    'prev_text'             => ' ',
    'next_text'             => ' ',
    'screen_reader_text'    => 'A'
)

like this:

if( have_posts() ){
    while( have_posts() ){
        the_post();?>
        the_content();?>
    <?php }
    echo get_the_posts_pagination(
        'mid_size'              => 1,
        'prev_text'             => '&nbsp;',
        'next_text'             => '&nbsp;',
        'screen_reader_text'    => 'A'
    );
    wp_reset_postdata();
}?>