Custom post type archive on a custom page template

This is seen as the “right” way to achieve what you describe: https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts

The above would alter your main loop so that you don’t have to create a new WP_Query in your template part. If you need more assistance with this hook then stackexchange covers a lot of similar questions

Alternatively you could leverage the Controller to make your data available in your template files, however the controller approach wouldn’t be as efficient as the pre_get_posts approach. More chatter about Controller usage here:

2 Likes