WordPress.org

Ready to get started?Download WordPress

Forums

Edit RSS Widget (11 posts)

  1. danaldinho
    Member
    Posted 4 years ago #

    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>";

    and

    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.

    Thanks

  2. danaldinho
    Member
    Posted 4 years ago #

    Anyone know? :)

    Thanks

  3. danaldinho
    Member
    Posted 4 years ago #

    Please can somone help, thanks.

  4. danaldinho
    Member
    Posted 4 years ago #

    Anyone got any ideas?

    Appreciate it.

  5. danaldinho
    Member
    Posted 4 years ago #

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

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

    link

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

    onclick="window.open(this.href,'newwin'); return false;">

  8. danaldinho
    Member
    Posted 4 years ago #

    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

  9. Don't know; you might need to escape the " with \ as in:

    onclick=\"window.open(this.href,'newwin'); return false;\">

  10. Svenjanssens
    Member
    Posted 4 years ago #

    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

    Thanks

  11. frankindelicato
    Member
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic