Most developers use a custom page template if they need to display a custom post types on the front/home page. This is fairly easy to do using a new WP_QUERY:
$args = array( 'post_type' => 'download', ); $downloads = new WP_Query( $args );
However, WordPress still treats this as a page rather than archive, which can be problematic if you have specific styles or scripts that only load on archives or rely on certain body classes. So I started to experiment with a pre_get_posts function. I found this actually works quite well, even with pagination and infinite scrolling scripts. Continue reading