Jetpack infinite scroll render – make different depending on post type?

Replace the above mytheme_render_infinite_scroll function with this:

function mytheme_render_infinite_scroll() {
    while ( have_posts() ) : the_post();
        if ('mytheme_portfolio' == get_post_type()) :
            get_template_part( 'content', 'archive-portfolio' );
        else :
            get_template_part( 'content', get_post_format() );
        endif;
    endwhile;
}