<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://mydrupalblog.lhmdesign.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>My Drupal Blog - Overriding Drupal&amp;#039;s Default RSS Feed Icon - Comments</title>
 <link>http://mydrupalblog.lhmdesign.com/overriding-drupals-default-rss-feed-icon</link>
 <description>Comments for &quot;Overriding Drupal&#039;s Default RSS Feed Icon&quot;</description>
 <language>en</language>
<item>
 <title>Nice tip :). You give good</title>
 <link>http://mydrupalblog.lhmdesign.com/overriding-drupals-default-rss-feed-icon#comment-10942</link>
 <description>&lt;p&gt;Nice tip :). You give good explanation especially when you called it &#039;The right Way&#039;.&lt;/p&gt;
</description>
 <pubDate>Tue, 20 May 2008 07:45:33 -0700</pubDate>
 <dc:creator>Jafar</dc:creator>
 <guid isPermaLink="false">comment 10942 at http://mydrupalblog.lhmdesign.com</guid>
</item>
<item>
 <title>Nicholas Thompson is</title>
 <link>http://mydrupalblog.lhmdesign.com/overriding-drupals-default-rss-feed-icon#comment-10843</link>
 <description></description>
 <pubDate>Fri, 25 Apr 2008 09:59:37 -0700</pubDate>
 <dc:creator>Caroline</dc:creator>
 <guid isPermaLink="false">comment 10843 at http://mydrupalblog.lhmdesign.com</guid>
</item>
<item>
 <title>*Delayed reaction*
@Nicholas</title>
 <link>http://mydrupalblog.lhmdesign.com/overriding-drupals-default-rss-feed-icon#comment-10782</link>
 <description>&lt;p&gt;*Delayed reaction*&lt;/p&gt;
&lt;p&gt;@Nicholas - thanks for the tip :)&lt;/p&gt;
&lt;p&gt;@Laura + Drupal Theme Garden - thanks! I do try to post as often as possible, but as you can see by this comment reply sometimes things take a looooong time.&lt;/p&gt;
</description>
 <pubDate>Wed, 09 Apr 2008 05:02:35 -0700</pubDate>
 <dc:creator>Laurence</dc:creator>
 <guid isPermaLink="false">comment 10782 at http://mydrupalblog.lhmdesign.com</guid>
</item>
<item>
 <title>Always glad to read your</title>
 <link>http://mydrupalblog.lhmdesign.com/overriding-drupals-default-rss-feed-icon#comment-10715</link>
 <description>&lt;p&gt;Always glad to read your blog.&lt;br /&gt;
It&#039;s shade that you don&#039;t write it more frequent.&lt;br /&gt;
Anyway, nice article.&lt;/p&gt;
</description>
 <pubDate>Mon, 24 Mar 2008 02:42:10 -0700</pubDate>
 <dc:creator>Drupal Theme Garden</dc:creator>
 <guid isPermaLink="false">comment 10715 at http://mydrupalblog.lhmdesign.com</guid>
</item>
<item>
 <title>This is the kind of</title>
 <link>http://mydrupalblog.lhmdesign.com/overriding-drupals-default-rss-feed-icon#comment-10668</link>
 <description>&lt;p&gt;This is the kind of wonderfully helpful tip that should be in the Drupal.org handbooks. Well written and clear enough that n00bs can &quot;get&quot; it. Very nice!&lt;/p&gt;
</description>
 <pubDate>Sat, 22 Mar 2008 15:08:45 -0700</pubDate>
 <dc:creator>Laura</dc:creator>
 <guid isPermaLink="false">comment 10668 at http://mydrupalblog.lhmdesign.com</guid>
</item>
<item>
 <title>An addition to make it even</title>
 <link>http://mydrupalblog.lhmdesign.com/overriding-drupals-default-rss-feed-icon#comment-10665</link>
 <description></description>
 <pubDate>Sat, 22 Mar 2008 10:51:40 -0700</pubDate>
 <dc:creator>Nicholas Thompson</dc:creator>
 <guid isPermaLink="false">comment 10665 at http://mydrupalblog.lhmdesign.com</guid>
</item>
<item>
 <title>Overriding Drupal&#039;s Default RSS Feed Icon</title>
 <link>http://mydrupalblog.lhmdesign.com/overriding-drupals-default-rss-feed-icon</link>
 <description>&lt;p&gt;By default, a number of Drupal themes (including Garland) output an RSS feed icon &lt;img src=&quot;misc/feed.png&quot; alt=&quot;Feed icon&quot; /&gt; at the bottom of pages which generate a feed.  The feed icon is generated because of the existence of the following code in the page.tpl.php file&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000BB&quot;&gt;&amp;lt;?php &lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;print &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;$feed_icons ?&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;But what if you want a different looking icon?  Maybe something larger, or a different color?&lt;/p&gt;
&lt;p&gt;Well, there are a couple of ways to achieve this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The not-so right way&lt;/li&gt;
&lt;li&gt;The right way&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;1. The not-so right way&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Drupal&#039;s default RSS feed icon image is located in your site&#039;s folder structure at &#039;misc/feed.png&#039;.  The not-so right way to change it is to simply swap this feed.png image for another feed icon image (just making sure to also name the new image feed.png).&lt;/p&gt;
&lt;p&gt;This method will work, but is not recommended. The reason being, that you are effectively overwriting a core file.  When you do an upgrade of Drupal, your new feed.png image will be replaced with the original feed.png image and you will need to update it again. This is clearly not a good idea if you have lots of sites or are doing sites for clients who do not know how to do such updates, and ultimately it&#039;s just an all round messy solution. &lt;/p&gt;
&lt;p&gt;So, a far better solution would be one where we do not alter any core stuff, and the new feed icon remains in place even after an upgrade...this is the right way.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. The right way&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The first thing we need to do is find out what function Drupal is using to output the feed icon. So, go over to &lt;a href=&quot;http://api.drupal.org/&quot; title=&quot;Drupal API&quot;&gt;Drupal API&lt;/a&gt;, and do a search for feed_icon. The search should return one result - theme_feed_icon.  This is exactly what we&#039;re after.  Anytime you see the word &#039;theme_&#039; at the beginning of a function it means that we can override the function - which is what we want to do in this case.&lt;/p&gt;
&lt;p&gt;The functions for Drupal 5 and Drupal 6 are as follows:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Drupal 5&lt;/em&gt; (&lt;a href=&quot;http://api.drupal.org/api/function/theme_feed_icon/5&quot; title=&quot;http://api.drupal.org/api/function/theme_feed_icon/5&quot;&gt;http://api.drupal.org/api/function/theme_feed_icon/5&lt;/a&gt;)&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;function &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;theme_feed_icon&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;$url&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp; if (&lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;$image &lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;= &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;theme&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;image&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;misc/feed.png&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;t&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;Syndicate content&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;), &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;t&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;Syndicate content&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;))) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;&amp;lt;a href=&quot;&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;. &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;check_url&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;$url&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;) .&lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;&quot; class=&quot;feed-icon&quot;&amp;gt;&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;. &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;$image&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;. &lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;&amp;lt;/a&amp;gt;&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;?&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Drupal 6&lt;/em&gt; (&lt;a href=&quot;http://api.drupal.org/api/function/theme_feed_icon/6&quot; title=&quot;http://api.drupal.org/api/function/theme_feed_icon/6&quot;&gt;http://api.drupal.org/api/function/theme_feed_icon/6&lt;/a&gt;)&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;function &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;theme_feed_icon&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;$url&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;$title&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp; if (&lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;$image &lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;= &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;theme&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;image&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;misc/feed.png&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;t&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;Syndicate content&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;), &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;$title&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;&amp;lt;a href=&quot;&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;. &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;check_url&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;$url&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;) .&lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;&quot; class=&quot;feed-icon&quot;&amp;gt;&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;. &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;$image &lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;.&lt;/font&gt;&lt;font color=&quot;#DD0000&quot;&gt;&#039;&amp;lt;/a&amp;gt;&#039;&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;?&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Now that we&#039;ve found our function, just do the following:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Create your new feed icon image, and save it to your theme&#039;s images folder at &#039;/sites/all/themes/yourthemename/images/feed.png&#039;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Copy the function for whichever version of Drupal you are using, and paste it into your theme&#039;s template.php file (you will not need the opening and closing PHP tags - just the function).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Replace the word &#039;theme&#039; at the beginning of the function name with the name of your own theme, like so:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;function mydrupalblog_feed_icon($url) {&lt;br /&gt;&amp;nbsp; if ($image = theme(&amp;#039;image&amp;#039;, &amp;#039;misc/feed.png&amp;#039;, t(&amp;#039;Syndicate content&amp;#039;), t(&amp;#039;Syndicate content&amp;#039;))) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &amp;#039;&amp;lt;a href=&amp;quot;&amp;#039;. check_url($url) .&amp;#039;&amp;quot; class=&amp;quot;feed-icon&amp;quot;&amp;gt;&amp;#039;. $image. &amp;#039;&amp;lt;/a&amp;gt;&amp;#039;;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; Finally, replace the path to the original feed icon with the path to your new feed icon, like so:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;function mydrupalblog_feed_icon($url) {&lt;br /&gt;&amp;nbsp; if ($image = theme(&amp;#039;image&amp;#039;, &amp;#039;/sites/all/themes/mydrupalblog/images/feed.png&amp;#039;, t(&amp;#039;Syndicate content&amp;#039;), t(&amp;#039;Syndicate content&amp;#039;))) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &amp;#039;&amp;lt;a href=&amp;quot;&amp;#039;. check_url($url) .&amp;#039;&amp;quot; class=&amp;quot;feed-icon&amp;quot;&amp;gt;&amp;#039;. $image. &amp;#039;&amp;lt;/a&amp;gt;&amp;#039;;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Drupal will now override the default feed icon and output your new feed icon in its place. As the change is being made in your theme&#039;s template.php file and the new image is in your images folder, it will not be overriden when you upgrade to a newer version.&lt;/p&gt;
</description>
 <comments>http://mydrupalblog.lhmdesign.com/overriding-drupals-default-rss-feed-icon#comments</comments>
 <category domain="http://mydrupalblog.lhmdesign.com/taxonomy/term/1">Drupal</category>
 <category domain="http://mydrupalblog.lhmdesign.com/topic/drupal-api">Drupal API</category>
 <category domain="http://mydrupalblog.lhmdesign.com/topic/drupal-theming">Drupal Theming</category>
 <category domain="http://mydrupalblog.lhmdesign.com/topic/feed-icon">Feed Icon</category>
 <category domain="http://mydrupalblog.lhmdesign.com/topic/rss">RSS</category>
 <category domain="http://mydrupalblog.lhmdesign.com/topic/template-php">template.php</category>
 <pubDate>Sat, 22 Mar 2008 07:30:02 -0700</pubDate>
 <dc:creator>Laurence</dc:creator>
 <guid isPermaLink="false">44 at http://mydrupalblog.lhmdesign.com</guid>
</item>
</channel>
</rss>
