• I could really use some help here. I need to have various RSS feeds for various categories that display different numbers of items. For example, I want the main feed to list all posts in all categories. Easy enough, I can change the RSS setting to “999” or something. I also know how to get the feeds for the different categories like so:

    http://example.com/wp-rss2.php?cat=42

    or, since I use clean permalinks, like this:

    http://example.com/category/tech/feed

    That all works fine. What I need is to be able to have these category feeds show different number of items, so the “tech” category’s feed would only list 5 items while the “web” category’s feed might list the last 10 items.

    I think this should be doable by copying the wp-rss2.php file and customizing it. One way might be to edit it so the number of items can be passed along via the url, like so:

    http://example.com/wp-rss2.php?cat=42?items=5

    (One issue here is if one uses clean permalinks — how would that be passed along?)

    Another way would be to have separate wp-rss2.php files, one for each category, with the category and number of items hardcoded into it. I would be fine with this, so I could have:

    wp-rss2-tech.php that lists the last 5 items in “tech” category and

    wp-rss2-web.php that lists the last 10 items in “web” category.

    I think this should work, but I can’t program php worth a lick. Can some kind soul either point me to another solution or, tell me how to edit the wp-rss2.php file so I can get these results? I would be really, really grateful and would send loads of good karma thoughts your way.

    Thanks and cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jacksons

    (@jacksons)

    Thanks for that link. I’ve installed it and it sorta works, but not totally. If I choose “if_rss” and limit it to say 5 articles and also choose a category, like tech, and limit that to 5 articles, the archive for the tech category will correctly only display 5 articles but the tech feed still lists them all.

    How does one do an “AND” operation with this plugin? I.e. if rss and if category “tech” then limit to 5 posts. Hard to tell exactly how to use this.

    I’ll keep working with this plugin. If there are any other ideas, or if anyone can tell me how to hack the wp-rss2.php file as described above, I’d really appreciate it. In fact, copying the wp-rss2.php file and hacking it is probably what I need to do, because I forgot to say that I also need a way to display two feeds for certain categories, one that lists just a few posts and one that lists all, so I am not sure the plugin will let me do that.

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

The topic ‘I really need help with custom rss feeds’ is closed to new replies.