WordPress.org

Ready to get started?Download WordPress

Forums

Change the RSS icon in 2.9 (4 posts)

  1. digitalrenewal
    Member
    Posted 4 years ago #

    Any CSS pros know how to change the default rss icon in the sidebar widget? Its been answered elsewhere but I cant get it to work in 2.9

    My output looks like this in firebug...

    <h2>
    <a href="http://domain.com/feed" class="rsswidget">
       <img src="http://domain.com/wp-includes/images/rss.png"/>
    </a>
    <a href="http://domain.com" class="rsswidget">
       from the main blog
    </a>
    </h2>

    I'm getting very close with css. here's what I have:

    #sidebar h2 .rsswidget img {display:none;}
    #sidebar h2 .rsswidget {background: url(images/rss.png) no-repeat; padding-left:24px;}

    because the class rsswidget is the h2 tag twice, the image shows twice when i use padding to move the text to clear the icon.

    I tried text-indent to move the text over, but it didnt work.

    Any ideas???

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    A link to your site might help...

  3. digitalrenewal
    Member
    Posted 4 years ago #

    I was gonna post a followup, but it said the topic was closed for some reason.

    I don't dislike the default rss icon, but I did figured out what was looking so strange about it... It has an orange background.

    i added the following css and fixed it

    #sidebar h2 .rsswidget img {background:transparent !important; padding-right:4px;}

    if you know how to replace the default rss icon, thatd be sweet!

    my site is here
    http://drlab.digitalrenewal.com/SEOtheme/

    Thanks!

  4. jon1938
    Member
    Posted 4 years ago #

    I'm certainly no pro, but I just had to fix this same thing due to the 2.9 update. It reverted it back to default for some reason... So I'd suggest taking out a pad of paper and noting this since future updates may revert it.

    Go to your wp-includes folder and find the images folder in there. There's a file called "rss.png". That's the file that wordpress uses for that little rss feed icon in the default widget.

    If you want to do more customization you can go the CSS route (by calling the class) or edit the default-widgets.php file itself (probably normally better to edit the CSS file). But you can edit the PHP file directly too. To do that, just go into the default-widgets.php file and look for the code relevant to the rss widget. Just do a search for "rss.png" within the php file since we know that's the image file the php file uses. In there you'll find the code that controls the formatting, etc.:

    ...

    "<img style='background:orange;color:white;border:none;' width='14' height='14' src='$icon' alt='RSS' /> $title";

    ...

    Just change the background:orange to background:none (or whatever color you want it to be) and you're done. Also, note the height and width is set to 14 pixels. That, of course, can be changed too... Anything can be... as I'm sure you now understand. As I mentioned above, you would probably be better served to just edit the CSS file. If you have issues with that this will always work. Hope that helps.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.