TyskJohan on “RSS feed for each category”
I just posted a little snippet to the WordPress support database which enables per-category RSS feed information in the category archives, so that you will get a subscription only to posts for the category whose archives you are viewing.
It’s an ugly hack and should probably be made into a plugin that overloads the wordpress method instead…
TyskJohan on “RSS feed for each category”:
OK here is what I added to the header template, if anyone’s interested.
< ?php
if (is_category()) {
$fullrss = get_category_rss_link(0,intval( get_query_var(cat)));
} else {
$full_rss = get_bloginfo_rss(rss2_url);
};
$rss2_url = $fullrss;
$rss_url = $fullrss.'rss/';
$atom_url = $fullrss.'atom/';
?>
2005-12-13 at 5.10 pm
That is some “nifty” code, I think I will go with it as well, but do not get my wrong though I really enjoy some Danish or French postings!
2005-12-13 at 5.37 pm
Well it might not work with your install of WordPress, as you don’t use the
mod_redirecthack. But it can clearly be tweaked to work for you too until I get around to making it general.But I’m sure you’ll manage to append the right stuff to the query string… Hint:
?cat=<?php echo intval(get_query_var(cat)); ?>&feed=[rss2|atom|rss]