• In index.php i have modify the loop code, but i think in index.php it’s not necessary specific if (is_home()) because it’s always the main page, how can i integrate this two code in one ?

    <?php
    if (is_home()) {
    query_posts(‘cat=1,2,3,4,5,7,9’);
    }
    ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Marcomail

    (@marcomail)

    Or do you have the best way to exclude two categories from the main page ?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    I use the CategoryVisibility-rh plugin for this sort of thing: https://ryowebsite.com/?p=46

    Very easy to use and configure, no need to edit any theme code.

    Thread Starter Marcomail

    (@marcomail)

    I wouldn’t use the category-visibily plugin, i want understand how can integrate this code in two line:

    <?php if (have_posts()) : while (have_posts()) : the_post();
    query_posts(‘cat=1,2,3,4,5,7,9’);
    ?>

    Is it correct ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘integrate this loop code’ is closed to new replies.