title: How do I get_posts from an Archive in WordPress?
body: <p>So, I successfully can get_posts from categories, but what about archives?  I need to say IF &lt;= 5 posts in an archive, get this footer.  It works for categories, I just need to get the archive.  Keep in mind I'm using archive.php, NOT archives.php.</p>
  
  <p>This is the code I used to get posts from a category:</p>
  
  <pre><code>&lt;?php
     $cat = get_query_var('cat');
     $posts = get_posts(array('category' =&gt; $cat));
  
       if(count($posts) &gt;= 5) {
         get_footer( 'home' );
       }
       else if(count($posts) &lt; 5){
        get_footer();
       }
  ?&gt;
  </code></pre>