• I hope this hasn’t been asked a hundred times. I searched, but couldn’t find an answer to this specific problem. The answer is probably simple, and I will feel dumb.

    That having been said:

    I’m building a custom category feed. I need it to have at least 50 entries in it at all times (I’m pulling the data into a custom visualizer). I’m using the following code at the moment:

    <?php while( have_posts()) : the_post(); ?>
    <?php if (in_category('1')) continue; ?>

    I only have two categories, this excludes the one I don’t want in the feed. unfortunately, this logic basically says this:

    Of the last [foo] number of posts (where [foo] is the “Show the most recent” setting) show all the entries that aren’t category 1.

    The problem with this, of course, is that in the last [foo] entries there may not be 50 entries in the category I want.

    I need logic that says:

    Give me the last 50 entries from category 2.

    I feel stupid that I haven’t found it, so any help will be appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Did you get this solved? I too am looking for info on how to keep certain things out of my feed.

    Don’t jump right into the Loop. Try this:

    <?php
    query_posts("cat=-1")
    while( have_posts()) : the_post();
    ?>

    The first line limits posts to those that are not in category 1 (the minus sign excludes the category). After that, the Loop behaves normally. You don’t need the ‘continue’ line, as no category 1 posts should show up.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Category RSS Feed question’ is closed to new replies.