WordPress.org

Forums

The best way (performance wise) to exclude a category from front page? (3 posts)

  1. jeriksson
    Member
    Posted 4 years ago #

    Hi,

    I've noticed that the query for excluding a category on front page does put a big load on the database (there's a lot of posts on this wp.

    The one i use looks like this:

    <?php query_posts($query_string . '&cat=-65'); ?>

    Is there any more efficient way of doing this with maybe a smarter query of some sort.

    Thank you!

  2. Michael Bishop

    Posted 4 years ago #

    I would recommend using WP_Query.

    This recent article does a nice job of going through the different ways to customize the loop.

    http://digwp.com/2011/05/loops/#wp-query

  3. jeriksson
    Member
    Posted 4 years ago #

    Very interesting, thank you exactly what i was looking for!

Topic Closed

This topic has been closed to new replies.

About this Topic