Replace the Feed (RSS) icon with a custom image
Last modified: August 27, 2009 - 02:35
The easiest way to do this is to replace the /misc/feed.png file with a custom graphic. If that's not possible, you can override which image displays as the XML icon with PHP.
With a PHPTemplate-compatible theme you can replace the
icon with one you've made yourself (and not just on the sidebar block but when it appears at the bottom of a page as well) by following the instructions below. It is based on the instructions on how to override a theme function.
- Either create a new theme or modify an existing theme.
- Create a file in that theme's directory called template.php or, if it already exists, edit the existing file.
- Insert the following code (replacing an entire phptemplate_feed_icon() function if it already exists), between the <?php ?> tags:
function phptemplate_feed_icon($url) {
$icon_url = 'path/to/new/icon';
if ($image = '<img src="'. $icon_url . '" alt="'. t('XML feed') .'" />') {
return '<span class="xml-icon"><a href="'. check_url($url) .'">'. $image .'</a></span>';
}
} - Visit Administer » Site building » Themes to register the new icon function.
- Enable the theme if necessary.

Unnecessary code
I _think_ the extra span tag in the example is unnecessary, the Drupal core doesn't use it either. Also the css in core is
<a href="something" class="feed-icon"><img></a>-certainly