WordPress.org

Ready to get started?Download WordPress

Forums

WP Nivo Slider
Make image links open in new window (5 posts)

  1. igloobob
    Member
    Posted 5 months ago #

    Hello,

    how is this done? My client claims she used to be able to do it (I can't remember to be honest) and now she can't. There's no option in the image editor within Nivo Slider. Is there any way to do it or can anyone point me in the direction of a core file that can be edited to achieve this as it's very important.

    Thanks

    http://wordpress.org/plugins/wp-nivo-slider/

  2. repsak
    Member
    Posted 5 months ago #

    Haven't got the plugin installed but you could try this.

    In wp-nivo-slider.php on line 140 try adding target="_blank"

    like this
    <a href="<?php the_permalink(); ?>" target="_blank" title="<?php the_title(); ?>">

  3. igloobob
    Member
    Posted 5 months ago #

    Hi repsak.

    I managed to get it working taking your lead above. The code is slightly different in the version of nivo slider I have but it works.

    It's not the ideal solution but definitely working for time being. Hoping the developer can add in the choice of open in new window when adding the links in the admin as not all links will be wanted to be a new window. For example some of our slides link to internal pages on our site (so should not be new window) but some are to other peoples sites (so should be new window).

    Thanks again!

  4. igloobob
    Member
    Posted 5 months ago #

    was this ever a feature int he plugin admin? My client swears she used to be able to choose when adding new slide links.

    So just like when adding any link in wordpress editor you can select the checkbox to open in new window. Exactly the same function.

  5. repsak
    Member
    Posted 5 months ago #

    I know next to nothing about php but adding something like this might solve it until you find something better. Not sure if the code is 100% correct but someone else might be able to fix it.

    Just replace the your domain name here part

    <?php
        $target = (strpos(the_permalink(), "your domain name here")? "" : "target=\"_blank\"");
    ?>
    
    <a href="<?php the_permalink(); ?>" <?php $target ?> title="<?php the_title(); ?>">

Reply

You must log in to post.

About this Plugin

About this Topic