Support » Themes and Templates » Limiting Posts Page to one category in TwentyEleven

  • 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.



Viewing 1 replies (of 1 total)
  • kitsuneyo


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

Viewing 1 replies (of 1 total)
  • The topic ‘Limiting Posts Page to one category in TwentyEleven’ is closed to new replies.