Replace the Feed (RSS) icon with a custom image

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 Drupal's feed icon 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.

  1. Either create a new theme or modify an existing theme.
  2. Create a file in that theme's directory called template.php or, if it already exists, edit the existing file.
  3. 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>';
      }
    }
  4. Visit Administer » Site building » Themes to register the new icon function.
  5. Enable the theme if necessary.
 
 

Drupal is a registered trademark of Dries Buytaert.