Proper way of handling custom post types in page templates

How to handle custom post type loops in page templates in sage/roots?

Before, I used this:

                 <?php
                 $args = array('post_type' => 'portfolio', 'post_per_page' => 3);
                 $loop = new WP_Query( $args );

                if(have_posts()):

                  while ( $loop->have_posts() ): $loop->the_post(); ?>

                    <?php get_template_part('content', 'archive'); ?>

                  <?php endwhile;

                endif;

               ?>

I tried to use that query as well on template-custom.php but gives me an infinite loop…

There is nothing different about queries in Sage

The archive template you’re calling in the example doesn’t exist in a default Sage install