WordPress.org

Ready to get started?Download WordPress

Forums

Add RSS Icon to Recent Posts Widget (2 posts)

  1. VerseD
    Member
    Posted 5 years ago #

    Hi,

    I'm trying to figure out how to edit my Recent Posts widget with an RSS icon and a link to my feed, similar to the sidebar at the K2 site.

    Does anyone know how to do this, or have examples of the code? I tried editing theloop.php but didn't know what I was doing.

    Thanks

  2. broadsword
    Member
    Posted 5 years ago #

    I was able to do this by hacking the widgets.php file. Make a backup of the existing file and try it on a local server to see if it works.

    Open widgets.php and search for the function wp_widget_recent_entries. Move down a few lines until you see a line called
    <?php echo $before_title . $title . $after_title; ?>
    My file had that at line 919. Then insert the following code on the next line, before the line that just has <ul> in it. What you insert will be hardcoded to your site's RSS feed, so you will need to change the code accordingly.
    <a href="http://thenameofyoursite.com/feed/" title="RSS Feed for Blog Entries" class="feedlink"><span>RSS</span></a>

    Then save the file and see if it suits your needs.

    Good luck.

Topic Closed

This topic has been closed to new replies.

About this Topic