Support » Fixing WordPress » How to list articles in (bullet style) under a category?

  • This is what my subject says, I have tried searching for it but no results.

    Also if I’m posting a post under any category, is it possible to stop it showing in front page? Just wondering, thanks.

Viewing 1 replies (of 1 total)
  • Passing on your first question, to exclude a category from the front page you introduce the exclusion directly inside the loop of the theme’s index.php

    The loop starts something like this:
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    To exclude category 4 from the front page, add this
    condition :

    <?php if ( !(in_category('4')) || !is_home() ) { ?>
    <!-- Output the post here -->
    <?php }>

    This means that if on the front page, the post will be presented if it’s not in category 4. On pages other than the front ( home ) page, all posts are presented.

    Don’t forget to close the if statement
    <php? }>

Viewing 1 replies (of 1 total)
  • The topic ‘How to list articles in (bullet style) under a category?’ is closed to new replies.