Support » Themes and Templates » Edit RSS Widget

  • How do you edit the RSS Wiget’s title and links so they can open up in a new window?

    I edited the default-widget file like this:

    $title = "<a class='rsswidget' href='$link' title='$desc' target='_blank' style='color:#ffffff;text-decoration:none;'>$title</a>";


    echo "<li><a class='rsswidget' href='$link' title='$desc' target='_blank'>$title</a>{$date}{$summary}{$author}</li>";

    But they still open in the same window, so there must be another file I need to edit, but I don’t know which one.

    I will be very grateful if someone could tell me and it is not the ‘wp-includes/widgets.php’ as I have looked in there.


Viewing 10 replies - 1 through 10 (of 10 total)
  • Anyone know? 🙂


    Please can somone help, thanks.

    Anyone got any ideas?

    Appreciate it.

    Damn, I hate to keep bumping, but can anyone help?

    Moderator Mark Ratledge


    Forum Moderator

    Maybe your target=’_blank’ is causing problems. I use this URL format for a link that opens in a new window:


    Moderator Mark Ratledge


    Forum Moderator

    That last comment didn’t output the code. Try this instead of target=’_blank’

    onclick=",'newwin'); return false;">

    Nope, that didn’t work.

    When you clicked on one of the links, it displayed this message:

    Parse error: syntax error, unexpected T_STRING in /home/dannym/public_html/blog/wp-includes/default-widgets.php on line 728

    Moderator Mark Ratledge


    Forum Moderator

    Don’t know; you might need to escape the ” with \ as in:

    onclick=\",'newwin'); return false;\">

    is kinda nice to read, but can’t even find the code that is in this posting inside my rss.php

    I’m looking all over for codes in my php pages that look like any of the ones I find in help-post, but it seems that I can’t find it, and I’ve been looking for it for about an hour now I think.

    I’m also trying to get the _blank working on my rss widget. Are there any other codes? Are there different kind of rss.php files?
    Can someone help me… 🙂

    Would be kinda nice 🙂
    If you want I’ll send you my rss,php file… the rss works on my site, but doesn’t open any link in _blank


    In the file wp-includes/default-widgets.php in the function wp_widget_rss_output towards the bottom of the function is the line:

    echo "<li><a class='rsswidget' href='$link' title='$desc'>$title</a>{$date}{$summary}{$author}</li>";

    change that line by adding the target=’_blank’ so it look like this:

    echo "<li><a class='rsswidget' href='$link' target='_blank' title='$desc'>$title</a>{$date}{$summary}{$author}</li>";

    And all your RSS links with open in their own window. The line in your initial post where you modified $title = may have been causing why it did not work for you.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Edit RSS Widget’ is closed to new replies.