Support » Fixing WordPress » Categories with only one post

  • Igloomason


    My Gallery child theme has a dropdown categories menu which I like. When a category (or sub-category) is clicked, all the thumbs of posts within that category are displayed. However, when a category with only one post is clicked, it too is displayed as a thumb. I’m attempting to re-code the category template so that a page with only one post defaults to the single post template. I’m unfamiliar with what function would “count” the # of posts within that category. Something like this in the categories template?:

    <?php $cat=get_post($count);
    if (1==$cat)
    <!– doing something with just one post –>
    <!– default template with multiple posts –>

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Categories with only one post’ is closed to new replies.