WordPress.org

Ready to get started?Download WordPress

Forums

Help needed: How to open rss-links in new window? (14 posts)

  1. tobbe_l
    Member
    Posted 5 years ago #

    Hi guys!

    Have to run my installed wordpress blog in an iframe (know it´s not a good solution but the only one that works for me right now).

    Problem is that the links from the rss-widget (rss from other blogs and so on) i have in the right column opens within the iframe. Not looking good.

    I´ve tried to find the right php-code to adjust this but havent found it/got it right. So here´s my questions:
    1. Which php-page/pages for the widget do i need to adjust the code in?
    2. How do I write the code correctly?

    Thanks for any help on this!

  2. vachi
    Member
    Posted 5 years ago #

    your solution is as simple as adding a _blank to the link code

    for example
    <a href="http://www.crunchyroll.com/rss/drama" target="_blank">http://www.crunchyroll.com/rss/drama</a>

    so here is a wordpress example
    <a href="<?php bloginfo('rss2_url'); ?>" target="_blank">Entries (RSS)</a>

  3. tobbe_l
    Member
    Posted 5 years ago #

    Thank´s Vachi. But problem is i can´t find the corresponding php-page to make this adjustment in. Would be grateful if you could help me out here!

  4. chocobo2k
    Member
    Posted 5 years ago #

    Just for those who are still looking... It depends where you want to put it. you can open your theme header.php and put the link under the search field for example.

  5. kuri2007
    Member
    Posted 5 years ago #

    Hello,

    I think my problem is similar to the one of tobbe_l.
    I'd like the RSS feeds (from other sites) that I added in widgets appear in a new window when they are clicked.
    What is the document to edit and where do I have to put the _blank code?

    You can see the feeds on my blog (they have a big rss icon):
    When you click on them, you quit my blog to go to another one!
    http://france-japon.net/
    I want to open a new window instead.

    Thanks for your help.

  6. cotton.rohrscheib@pleth.com
    Member
    Posted 5 years ago #

    This seems to be a mystery...
    Before stumbling onto this post I also posted the same question here:
    http://wordpress.org/support/topic/229767?replies=2

    So far I haven't gotten a response yet either.

  7. cotton.rohrscheib@pleth.com
    Member
    Posted 5 years ago #

    Does anyone know of a paid service where we might could locate an answer to this question? I am not having very much luck in getting a response on these forums. Not complaining, these things exist on a volunteer basis but would like to know of some alternatives. This is one of those rare cases where an answer to an issue is not readily available from within the community.

  8. jBuzz
    Member
    Posted 5 years ago #

    Just look in one of the widget.php files and add target='_blank' to make new window open... look earlier in this post for a full syntax.

  9. cotton.rohrscheib@pleth.com
    Member
    Posted 5 years ago #

  10. morcom
    Member
    Posted 4 years ago #

    Sorry cotton.rohrscheib@pleth.com I would have loved your solution to work however I'm now running WordPress 2.8. and they have changed the widget.php file.
    It's now less that 1,300 lines and the code identified is no longer there.
    Thanks anyway

  11. GrandSlambert
    Member
    Posted 4 years ago #

    Why is this not an option built into WordPress? I have looked for hooks into this widget to see if I can create something but can not seem to find any place to do this. Has anyone figured this out?

  12. milprod
    Member
    Posted 4 years ago #

    @morcom
    I believe this part moved to the defaults-widgets.php in wp-includes.
    I found it in lines 728 & 837

    edit: search for: href='$link'
    and replace with: href='$link' target='_blank'

  13. Josefus Flavius
    Member
    Posted 4 years ago #

    Thanks, Milprod - works perfectly!

    I've been looking, and looking, and looking for a solution...

    VERY much appreciated!

    JF

  14. milprod
    Member
    Posted 4 years ago #

    It worked for me, too, in 2.8.3 !!!
    @JF: don't forget to save your changes separately (or write it down somewhere) because an upgrade will override the wp-includes !

Topic Closed

This topic has been closed to new replies.

About this Topic