Website feed is a data format used to provide frequent content updates. Feed readers are programs that gather website feeds containing frequently updated information and they display that information for various websites. It’s a great way to keep up with the latest news and information. Really Simple Syndication (RSS) feeds, as you see them called are the standards for blog syndication and used across personal and business online presences.

WordPress has many types of built-in feeds. All of them enable a person to read content in their email, through feed readers, or their mobile devices. RSS content contains everything from the author name and publish date to a summary of the content and bits of metadata. Due to WordPress having built-in support, every page you publish will have a meta tag that points right at the location of your RSS feed. You can disable this function, but you may not want to do that and that is why here at Templatetoaster WordPress theme builder and WordPress theme generator this article is focused on actually using the feeds.

Some of the benefits of RSS feeds are:

  • It’s easier for people to subscribe to your content
  • They are notified of new content from your blog through their feed reader program, desktop application, or in their email.
  • You eliminate the problem of subscribers forgetting your URL
  • The content is portable and can be read offline
  • You build a loyal following

You will need to find your feed URL. There may be times that people want it or you need to submit it to a website, directory, or search engine. There are four URLs that can work. They are:

[box]

  • http://mysite.com/?feed=rss
  • http://mysite.com/?feed=rss2
  • http://mysite.com/?feed=rdf
  • http://mysite.com/?feed=atom[/box]

Specifying feeds for categories, tags, authors, and search

WordPress will have its own default setting for your feed. However, you can specify what you want to appear in the feed. You can specify categories, tags, authors, and search results can have their own feed.

For categories and tags, you can use:

[box title=””]http://www.mysite.com/?cat=42&feed=rss2[/box]

You have to get the category ID from your category menu under Categories in the admin panel. In this case, the category ID is 42. If you want to list multiple categories, you can do

[box] http://mysite.com/?cat=42,44&feed=rss2. [/box]

To do this with a tag, it is going to look like this:

[box] http://mysite.com/?tag=tagname&feed=rss2 [/box]

Make sure the tag is typed in exactly as you have used it in the tag field of your posts.

To create a feed for an author, you will use:

[box] http://mysite.com/author/authorname/feed/ [/box]

To create a feed for search, use:

[box] http://mysite.com/?s=searchterm&feed=rss2 [/box]

Adding a Feed

If you have a WordPress theme that doesn’t have all of the RSS feed types, then you can add a feed. You will need to locate the other feeds that are in your footer or sidebar. You can then add this code to the footer or sidebar of your template file. You can use the above examples when specifying the type of content you want the feed to display.

[box]

<ul class=”feeds”>

<li><a href=”<?php bloginfo(‘rss2_url’); ?>” title=”<?php _e(‘Syndicate this site using RSS’); ?>”><?php _e(‘<abbr title=”Really Simple Syndication”>RSS</abbr>’); ?></a></li>

<li><a href=”<?php bloginfo(‘atom_url’); ?>” title=”<?php _e(‘Syndicate this site using Atom’); ?>”><?php _e(‘Atom’); ?></a></li>

<li><a href=”<?php bloginfo(‘comments_rss2_url’); ?>” title=”<?php _e(‘The latest comments to all posts in RSS’); ?>”><?php _e(‘Comments <abbr title=”Really Simple Syndication”>RSS</abbr>’); ?></a></li>

</ul>

[/box]

Adding Graphics to Feeds

You are allowed to add the <image> element to the header of your WordPress website’s RSS feed. It is good to have a more recent version of WordPress so that this process is much easier than it used to be.
To add a graphic to the header of your feed, you will need to enter some code to the functions.php file:

[box]

function add_my_rss_image()
{
echo ‘<image><title>’, bloginfo_rss(‘name’), ‘</title>’;
echo ‘<url>’, bloginfo_rss(‘stylesheet_directory’), ‘/images/button.gif</url>’;
echo ‘<link>’, bloginfo_rss(‘url’), ‘</link>’;
echo ‘<width>88</width><height>31</height>’;
echo ‘<description>Description of your blog.</description></image>’;
}

add_action(‘rss2_head’,’add_my_rss_image’);
add_action(‘rss_head’,’add_my_rss_image’);
add_action(‘commentsrss2_head’,’add_my_rss_image’);

[/box]

You can upload the image to your media library and use that URL where the URL to the image must be inserted. You can also adjust the height and width accordingly so the feed header looks its best. If you aren’t comfortable with manual insertion, the Better RSS Feed plugin will make styling your RSS feed much easier than having to do it manually.

By styling your feed, it will make promoting it easier because it will look more appealing. Because WordPress already publishes the RSS feed, you can encourage visitors to subscribe to that feed by making sure the RSS icon is located in a noticeable place on your website. The RSS feed icon is now available in many social sharing or social subscription bars.

You can then use a Feed burning service like Feedblitz or Feedburner to obtain statistics about your feeds. If you use Feedburner, you will have to have a Google account. This is a place where you will need to know the URL to your RSS Feed. You will choose a title for your feed, choose a feed address, and then you can dress your feed up a bit. Feedburner then gives you different options for optimizing your feed.

Cool RSS Tricks

There are different tricks you can use to make RSS even more effective for you. Some of those tricks are:
1. You can control when your posts are available via an RSS feed. This code will do the job when you paste it in your functions.php file:

[box]

function publish_later_on_feed($where) {
global $wpdb;

if ( is_feed() ) {
// timestamp in WP-format
$now = gmdate(‘Y-m-d H:i:s’);

// value for wait; + device
$wait = ‘5’; // integer

// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
$device = ‘MINUTE’; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR

// add SQL-sytax to default $where
$where .= ” AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, ‘$now’) > $wait “;
}
return $where;
}

add_filter(‘posts_where’, ‘publish_later_on_feed’);

[/box]

2. You can insert ads into your RSS Feed. All you have to do is go to the functions.php file and paste this code into the file:

[box]

<?php
function insertAds($content) {
$content = $content.'<hr /><a href=”http://www.wprecipes.com”>Have you visited WpRecipes today?</a><hr />’;
return $content;
}
add_filter(‘the_excerpt_rss’, ‘insertAds’);
add_filter(‘the_content_rss’, ‘insertAds’);
?>

[/box]

3. Use this code to display any RSS feed on your blog:

[box]

<?php include_once(ABSPATH.WPINC.’/rss.php’);
wp_rss(‘http://feeds.feedburner.com/wprecipes’, 3); ?>

[/box]

These are just some of the neat things that you can do to ensure RSS feeds display the way that you want them to. Some people are not aware that they can have control, but you have quite a bit of control.

Conclusion

An RSS feed can be a good promotional tool for your blog. It keeps subscribers from forgetting about you like people tend to do when they haven’t visited your blog enough. By having this nice reminder coming into their feed readers, email accounts, and other devices, you can stand out from others that don’t utilize the full power of RSS.

 

[call_to_action color=”gray” button_icon=”download” button_icon_position=”left” button_text=”Download Now” button_url=”https://templatetoaster.com/download” button_color=”violet”]
Create responsive and cross-browser compatible WordPress themes in minutes using TemplateToaster website builder software
[/call_to_action]