Thord Daniel Hedengren - Smashing WordPress_ Beyond the Blog-Wiley (2014)

(avery) #1

CHAPTER 6 • Advanced Theme Usage 165


Lesson two is to seriously consider full feeds. You can choose whether you want to send out a
full feed or one just featuring excerpts. Feeds containing just excerpts will have fewer sub-
scribers because people using RSS prefer to get the whole story. You’ll find that a large number
of these readers will click the links and visit your site anyway, but they may just opt out if
you’re not publishing full feeds. Then again, if you really, truly, definitely have to get people to
your site, and having them read the content in a feed reader is a disaster, then fine. Just make
sure that you know what you’re doing, and why, if you’re truncating your feed.


The third and final lesson is to offer alternative subscription methods. There are several
options here, with everything from RSS to Twitter plugins and newsletters populated by
stories from your RSS feed. The latter can be done in any number of ways, but one of the
better solutions comes from Mailchimp (http://mailchimp.com), which is free for a
certain amount of subscribers. RSS feeds are great and powerful tools, especially when you
combine them with services such as Mailchimp or IFTTT (http://ifttt.com) that can
help you reach beyond your site and its RSS subscribers.


THE WORDPRESS FEEDS


WordPress outputs a number of feeds if you let it. You can get them easily enough, using the
bloginfo() template tag:


<?php bloginfo( 'rdf_url' ); ?>
<?php bloginfo( 'rss_url' ); ?>
<?php bloginfo( 'rss2_url' ); ?>
<?php bloginfo( 'atom_url' ); ?>


These are for the deprecated 0.91 RSS feed, which redirects to the default feed; version 1.0 of
the RSS feed; the 2.0 RSS feed; and the Atom feed, respectively.


You can also get the feed for your comments, as well as an individual post’s comments.
Naturally, you’d want to use these tags in your theme:


<?php bloginfo( 'comments_rss2_url' ); ?>
<?php comments_rss_link( 'RSS 2.0' ); ?>


The second one is for a specific post’s comments feed.


However, I personally prefer to keep the PHP calls to a minimum. All these feeds can be
found by directly inputting the URL. Because you understand the necessities of permalinks
(or will, when you’ve finished reading this chapter), you’ve got your blog set up to use these.
This means that these URLs will work for you:


◾ http://mydomain.com/feed
◾ http://mydomain.com/feed/rss
◾ http://mydomain.com/feed/rss2
◾ http://mydomain.com/feed/rdf
◾ http://mydomain.com/feed/atom
Free download pdf