title: Case Statement for MyPosts Query Not Working
body: <p>I'm stuck on query I am trying to write. My goal is to create 3 use cases depending on how many posts are in category 24 for a slider. For no posts in category 24, I'd like to hide all the code. For one post in category 24, I'd like to output HTML that styles the single post. For multiple posts, I'd like to output HTML that styles the posts in a slider.</p>
  
  <p>My problem is that my code works fine if there are no posts and if there is one post, but it seems to get stuck if there are multiple posts. It just outputs the case for the one post. Any help would be appreciated! </p>
  
  <pre><code>    &lt;div id="posts"&gt;
          &lt;?php
      $myposts = get_posts('posts_per_page=-1&amp;category=24');
      // Check to make sure you have an array, set the postcount to zero if you don't.
      if (is_array($myposts)) {
          $postcount = count($myposts);
      } else {
          $postcount = 0;
      }
      switch($postcount) {
          case 0:
              //  Do nothing, so no code here for no posts.
          break;
          case 1:
              // Code here for what you want to do if there is only one post.
  ?&gt;
              &lt;?php query_posts($query_string . '&amp;cat=24&amp;posts_per_page=1'); ?&gt;
   &lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;
              &lt;div class="onefeatured-post"&gt;
      &lt;ul id="onefeatured-post-list"&gt;&lt;div class="onefeatured-post-image"&gt;
                  &lt;?php featured_post_image(); ?&gt;
              &lt;/div&gt;
  
              &lt;div class="onefeatured-post-text"&gt;
                  &lt;h2 class="onefeatured-post-title"&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" title="&lt;?php the_title(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
                  &lt;div class="onefeatured-post-content"&gt;&lt;?php limits(160, "Read more"); ?&gt;&lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="clearfix"&gt;&lt;/div&gt;
          &lt;/li&gt;&lt;/ul&gt;
      &lt;div class="onefeatured-post-nav"&gt;
          &lt;div id="onefeatured-post-pages"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;?php endwhile; ?&gt;
  &lt;?php endif; ?&gt;
  &lt;?php
          break;
          default:
              // Code here for what you want to happen if there is more than one post.
              include (TEMPLATEPATH . '/featured-posts.php');
  } ?&gt;
  </code></pre>