• 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

Viewing 1 replies (of 1 total)
  • 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="https://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.

Viewing 1 replies (of 1 total)
  • The topic ‘Add RSS Icon to Recent Posts Widget’ is closed to new replies.