Do you blog about a lot of different topics? If yes, you may want to provide a rss feed per category, so your readers will be able to only read what interests them. Believe it or not, this is very easy to achieve.
Do you blog about a lot of different topics? If yes, you may want to provide a rss feed per category, so your readers will be able to only read what interests them. Believe it or not, this is very easy to achieve.
This recipe is probably one of the easiest to achieve I have ever published, but it is very useful. Let's say you'd like to be able to only suscribe to Cats Who Code blogging tips. The category url is:
http://www.catswhocode.com/blog/category/blogging
To get a rss feed, you simply have to add /feed at the end of the url:
http://www.catswhocode.com/blog/category/blogging/feed
To create a category rss feed, simply paste the following code:
<a href="<?php echo get_the_category().'/feed'; ?>"><?php echo get_the_category().' rss feed'; ?></a>
One Response
There are several ways to read RSS feed in PHP, but this one is surely one of the easiest.
channel->item as $entry) {
echo “link’ title=’$entry->title’>” . $entry->title . “”;
}
?>
Source:
http://phphelp.co/2012/04/23/how-to-read-rss-feed-in-php/
OR
http://addr.pk/a0401
Trackbacks: