WordPress.org

Ready to get started?Download WordPress

Forums

Limiting Posts Page to one category in TwentyEleven (2 posts)

  1. Freelancealot
    Member
    Posted 3 years ago #

    So I've searched and searched and spent a few hours sticking code in various templates withing a child theme I'm doing for TwentyEleven, but to no avail.

    From section on WordPress Codex about the Loop, it seems I should be putting this:

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

    just before

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

    But it doesn't seem to have any effect no matter where I put it.

    The set up is this:

    Front page displays a static page:

    Page called Welcome set as Front Page.
    Page called The Blog set as the Posts Page (default template).

    There's a category I don't want to appear on this Posts page. How do I make that happen?

    I've set up a page showing just this category (id 38) which works, so I know the category number is correct.

    Can someone please let me know which template I need to add the above code? I've tried quite a few!!

    Alternatively, is there a way to do this via the functions.php in the child theme?

    Any help much appreciated.

    Cheers,

    Tracy

  2. kitsuneyo
    Member
    Posted 2 years ago #

    I need pretty much exactly the same information, or a link to a good guide at least. Can anyone help?

Topic Closed

This topic has been closed to new replies.

About this Topic