I’ve noticed a handful of useful WordPress websites which allow users to subscribe to specific RSS Feeds for particular categories. Prior to seeing this, I did not know that the WordPress installation had any more than the one basic feed URL. The normal feed URL with wordpress is: http://website.com/feed/. I wanted to make it easier for the readers to subscribe to very specific topics – rather than get notified of everything that is updated. So, after searching for a wordpress plugin, and having no luck with any of the possible choices – I just created it by myself. If you are having problems with the same issues, this quick guide might help you.

Location

  • FIrst, figure out where on your website that you would like the “Subscribe to Topics” links to occur. The sidebar (either on the left-hand or right-hand side of your website is a typical location, although the links could be placed elsewhere).
  • In this example, I will be putting the “Subscribe to Topics” links in the sidebar. Figure out exactly where you want it to show up. If you are totally unfamiliar with web design or editing files, this will be a learning experience for you.

Format for Category RSS Feeds with WordPress

  • The actual format of your feed URLs will vary. Most people use Permalinks (to create SEO-friendly URLs) and if that is the case, your feed URLs will be in this format: http://website.com/feed
  • If you want to create feeds for multiple categories, so people can subscribe to only what is of interest to them, you can do that as well. Format for feeds of specific categories is: http://website.com/categoryname/feed. For subcategory feeds, the RSS Format is: http://website.com/categoryname/subcategoryname/feed. It’s pretty simple, and there are a few different possible URLS structures for the feeds, but you get the basic idea.
  • Personally, I prefer to use the format just mentioned. But, for those who know what they are doing, and would like to have the feed in an alternate format, these are possible options:
  • http://website.com/feed/
  • http://website.com/feed/rss/
  • http://website.com/feed/rss2/
  • http://website.com/feed/rdf/
  • http://website.com/feed/atom/

For more details about all possible uses and formats, please refer to the WordPress information here.

Create Your Feeds List

  • Now you must figure out which feeds you want to offer custom RSS Feeds for. Open up notepad and type out all the URLs and names of the feeds you would like to create. To find the correct URL, you will need to know the URLs to your category pages. Most websites with widgets allow you to create a widget that has a list of your categories. If you can do that, it will make it quite easy for you to get the URLs. Just scroll over the link to that category, copy the URL link and paste it into your notepad file.
  • The reason we are doing this manually instead of using a piece of PHP code to pull the category feeds in is because I want to be able to hand-choose the feeds I want to create (I also don’t know enough about PHP and don’t have the time to figure it out).
  • Here are some of the category feed URLs that I want to create for my example:
  • Subscribe to All Topics http://wordpress-tutorials.info/feed
  • Subscribe to All Comments http://wordpress-tutorials.info/comments/feed
  • Making Money http://wordpress-tutorials.info/topics/make-money-online-honestly/feed
  • Blogging http://wordpress-tutorials.info/topics/blogging-101/feed
  • The place in the URL above that shows “topics” might need to be replaced with the word “categories,” but that depends on your permalink structure and how your URLs are setup.

Putting it Together with HTML

  • In order to create a nice looking graphic RSS Image with the hyperlinks to each specific feed, you will need to put it in the proper HTML format. The format for the four links above, can be seen here. You can use this very format for your links.
  • You don’t need to know what all the code means, but you need to be able to insert in your URLs in place of those – and the topic names in place of the ones there as well.

<div id=”sidebarfeeds”>
<ul>
<li><a href=”http://wordpress-tutorials.info/feed”>Subscribe to All Topics</a></li>
<li><a href=”http://wordpress-tutorials.info/comments/feed”>Subscribe to Comments</a></li>
<li><a href=”http://wordpress-tutorials.info/topics/blogging-101/feed”>Blogging</a></li>
<li><a href=”http://wordpress-tutorials.info/topics/make-money-online-honestly/feed”>Business Preparations</a></li>
</ul>
</div>

Create Your Widget Now
  • Now that you have the code that you need, it is time to create the widget. Login to your WordPressadmin area, scroll over the DESIGN tab and click on WIDGETS. On the left-hand side, find a widget that says “TEXT” (next to it, you should see “arbitrary text or html.” Click to Add it to your sidebar. Then place it anywhere that you want these links to show up at.
  • Find the new sidebar widget on the right-hand side, and click edit. A box will open up and allow you to insert code or text. You will want to insert the HTML code that you just created.
  • As you can see, the code starts with the <div id=”sidebarfeeds”> and ends with a </div>
  • The reason I used that special piece of code is because i wanted the list of links to appear in a reallynice and professional format. In order to do that, I needed to create a special piece of code to put into my stylesheet (style.css). For those who have no idea what I am talking about, my intention is not to overwhelm you! Basically, a stylesheet is a type of file that contains all of the details for specific design elements on your website; placement of objects, spacing and images, etc. I created a special style for this to look nice. (you can get the code for that below the screenshot here)

Final Step – Adding the Style to the Stylesheet

  • So, the final step here is to add the special style to the stylesheet.
  • Here is the code I used:

#sidebarfeeds { width:280px;
float:right;
margin-bottom:10px;
padding:0px 5px 0px 5px;
background:#fff;
}

#sidebarfeeds li {
list-style:none;
border-bottom:1px dotted #ccc;
display:block;
padding:2px 0px 2px 25px;
background:url(/wp-content/uploads/icons/021.png) no-repeat 0 0px; }

  • That information was added to my style.css file. That file was located at: http://website.com/wp-content/themename/style.css
  • You can add it to the end of your file or anywhere in between – just be sure to keep it in tact as it is here. Don’t forget any of the code.
  • You will most likely need to alter the code slightly -because your sidebar might be smaller than mine is. The sidebar itself for my website is 300 pixels wide. So, the normal size for this is 20 pixels less – which is why you see in the style code it is 280px wide. It also has some padding around it.
  • The second part of the code is for the list of links that will appear with the graphic RSS Feed image next to them. So, you will need to have an actual RSS feed image if you want one to appear. You will need to use an FTP program or file manager to upload an actual RSS image that you want to use. As you can see above, my file location for the uploaded graphic was at: /wp-content/uploads/icons/021.png. You can upload your image wherever you like, just be sure to put the correct URL path to it in the stylesheet code above (replace mine). If you don’t know the correct format, you can alternatively put the direct path to it, for example: http://website.com/wp-content/uploads/icons/name.png.
  • Once your stylesheet has the new style inserted, just save it. Save your new widget and place it anywhere you want the feed to appear. That’s it!

If you have any trouble with the style of the new widget (the size or padding, etc.) my only suggestion is that you copy some of the code from your other widgets. Keep it the same width, same padding and margins as the widgets above and below it and you should be fine!

That’s it! I hope this helped you!

If you found this article useful then please share it !
Trackback

no comment untill now

Add your comment now