WordPress.org

Support

Support » Requests and Feedback » Request: Allow user templates for rss/rss2/atom

Request: Allow user templates for rss/rss2/atom

  • As of WP 1.5.1-alpha nightly, the default rss, rss2 and atom templates do not include sections for adding images or favicons. For example, I’d like to add an image section to my feed like so:

    <image>
    <link>http://www.gudlyf.com/</link&gt;
    <url>http://www.gudlyf.com/gudlyfs_world.jpg</url&gt;
    <title>My blog title.</title>
    </image>

    However, I’d have to edit the default templates in WordPress. I’d very much like the ability to have files such as ‘rss.php’, ‘rss2.php’, and ‘atom.php’ in ones theme directory so these fields can be added without mucking with the default themes.

    If there’s another way to do this though, I’m all ears.

Viewing 1 replies (of 1 total)
  • Suggested patch to make this work (tested and works for me):

    Index: wp-feed.php
    ===================================================================
    — wp-feed.php (revision 2403)
    +++ wp-feed.php (working copy)
    @@ -13,23 +13,41 @@
    }

    if ( is_single() || ($withcomments == 1) ) {
    – require(‘wp-commentsrss2.php’);
    + if ( file_exists(TEMPLATEPATH . “/commentsrss2.php”) )
    + require(TEMPLATEPATH . “/commentsrss2.php”);
    + else
    + require(‘wp-commentsrss2.php’);
    } else {
    switch ($feed) {
    case ‘atom’:
    – require(‘wp-atom.php’);
    + if ( file_exists(TEMPLATEPATH . “/atom.php”) )
    + require(TEMPLATEPATH . “/atom.php”);
    + else
    + require(‘wp-atom.php’);
    break;
    case ‘rdf’:
    – require(‘wp-rdf.php’);
    + if ( file_exists(TEMPLATEPATH . “/rdf.php”) )
    + require(TEMPLATEPATH . “/rdf.php”);
    + else
    + require(‘wp-rdf.php’);
    break;
    case ‘rss’:
    – require(‘wp-rss.php’);
    + if ( file_exists(TEMPLATEPATH . “/rss.php”) )
    + require(TEMPLATEPATH . “/rss.php”);
    + else
    + require(‘wp-rss.php’);
    break;
    case ‘rss2’:
    – require(‘wp-rss2.php’);
    + if ( file_exists(TEMPLATEPATH . “/rss2.php”) )
    + require(TEMPLATEPATH . “/rss2.php”);
    + else
    + require(‘wp-rss2.php’);
    break;
    case ‘comments-rss2’:
    – require(‘wp-commentsrss2.php’);
    + if ( file_exists(TEMPLATEPATH . “/commentsrss2.php”) )
    + require(TEMPLATEPATH . “/commentsrss2.php”);
    + else
    + require(‘wp-commentsrss2.php’);
    break;
    }
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Request: Allow user templates for rss/rss2/atom’ is closed to new replies.
Skip to toolbar