A Quick Tip For WordPress Theme Authors

nobrainer nailed me a couple of days ago for not having auto-discoverable feeds on my site. The process for adding them to your WordPress is a rather simple one.

Add the following code to your document's <head> section (usually header.php in WP themes):

  1.  
  2. <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
  3. <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
  4. <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
  5. <?php if (is_single() or is_page()) { ?>
  6. <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
  7. <?php } ?>
  8.  

This will alert RSS/Atom-aware browsers of the presence of your RSS, RSS2 and Atom (0.3) feeds. The last portion of the code will alert pingback-aware blogging apps of the pingback URL on each of your pages/posts so that authors linking to your content will automatically be able to generate pingbacks.

Hope this helps a few others out of the sandtrap I found myself in.

Get a Trackback link

No Comments Yet

You can be the first to comment!

Leave a comment