• Resolved imbatido

    (@imbatido)


    Hello,

    I want to exclude a category from my home page, but I can’t get it to work. I searched a lot, found some topics and read the Codex, but my PHP-skills are close to 0 so it doesn’t work. I just started with WordPress and I’m still learning.

    The current code is the following. I want to show 5 posts and exclude category 17.

    <?php query_posts(array('posts_per_page' => 5)); if (have_posts()) : while (have_posts()) : the_post(); ?>

    Thanks a lot!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How to exclude a category with PHP?’ is closed to new replies.