title: How to use a custom post type archive as front page in WordPress?
body: <p>I'd like to use a custom post type archive as a site's front page, so that </p>
  
  <pre><code> http://the_site.com/
  </code></pre>
  
  <p>is a custom post type archive displayed according to my <code>archive-{post-type}.php</code> file.</p>
  
  <p>Ideally I would like to alter the query using <code>is_front_page()</code> in my <code>functions.php</code> file. I tried the following, with a page called "Home" as my front page:</p>
  
  <pre><code> add_filter('pre_get_posts', 'my_get_posts');
   function my_get_posts($query){
       global $wp_the_query;
       if(is_front_page()&amp;&amp;$wp_the_query===$query){
          $query-&gt;set('post_type','album');
          $query-&gt;set('posts_per_page',-1);
       }
       return $query;
   }
  </code></pre>
  
  <p>but the front page is returning the content of "Home" and seems to be ignoring the custom query.</p>
  
  <p>What am I doing wrong? Is there a better way, in general, of going about this?</p>
  
  <p><em>Note: I did post this in <a href="https://wordpress.stackexchange.com/questions/30851/how-to-use-a-custom-post-type-archive-as-front-page">WordPress Answers</a> but that community is comparatively tiny.</em></p>