I really need help with custom rss feeds
-
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!
The topic ‘I really need help with custom rss feeds’ is closed to new replies.