WordPress.org

Ready to get started?Download WordPress

Forums

Simple RSS Feeds Widget
Having the links open in a new window (8 posts)

  1. cocobeware
    Member
    Posted 3 years ago #

    Is it possible to edit the widget so that links open in a new window?

    Thanks!

  2. rspro
    Member
    Posted 3 years ago #

    PLEASE CAN YOU LET ME KNOW HOW I CAN OPEN LINKS IN A NEW WINDOW E.G

    WHERE SHOULD I PUT THE CODE AND WHAT CODE IS IT

    TARGET="BLANK"

    I NEED TO KNOW WHERE TO INSERT IT IN THE SCRIPT

  3. ryansequeira
    Member
    Posted 2 years ago #

    Hello,

    I would also like to know the answer to this question. I run a website for a local church and I would very much like RSS article links to open in a new page. Do I need to edit the PHP file? If so, where do I change it, and what code should I use? I am not familiar with PHP

  4. zondar
    Member
    Posted 2 years ago #

    This looks very promising.

    Like the folks above, I reckon 'open in new window' is pretty essential and would round the plugin off nicely.

    Somehow, remembering to 'right-click and open in new tab' just isn't intuitive.

    Here's hoping for a wee tweak from the developer!

    Cheers

  5. mr_swede
    Member
    Posted 2 years ago #

    Go to Plugins --> Editor and select "Simple RSS Feeds Widget".
    Edit the file "simple-rss-feeds-widget/simplerssfeedswidget.php".

    Go to line 317 and insert 'target=_blank' so that the line looks like this:

    echo( '<li><a title="'.date_i18n( get_option( 'date_format' ), $item->get_date( 'U' ) ).'" target=_blank href="'.$item->get_permalink().'">'.$item->get_title().'</a>' );

    You have to be careful when updating this plugin next time since your "hack" will be overwritten by the update.

    Happy RSS'ing!

  6. ryansequeira
    Member
    Posted 2 years ago #

    Hi Mr. Swede,

    I tried your suggestion, and I keep getting error messages from WordPress saying the plugin was deactivated because of a fatal error:

    Parse error: syntax error, unexpected '.' in /hsphere/local/home/*username*/*domain*/wordpress/wp-content/plugins/simple-rss-feeds-widget/simplerssfeedswidget.php on line 366

    sometimes it gives me an error on line 317, sometimes 365.

    Any idea why this might be happening?

    Thanks!

  7. mr_swede
    Member
    Posted 2 years ago #

    I suggest you reinstall the plugin and try again. It looks as if you unintentionally made other changes to the php file.

    I downloaded the plugin with an FTP client and used a text editor to perform the changes locally before uploading it to my site.

  8. zondar
    Member
    Posted 2 years ago #

    @mr_swede,

    Thanks for the mod - it now works a treat.

    Nice work.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic