[slide caption url in a new window

  • Posted in : Responsy WP
  • steffonpixelwars
    Participant

    Hello,

    I wanted to make a slider with a target=”_blank” link.
    Is it possible ? Like that for example :
    [slide caption=”” url=”mylink” target=”_blank” src=”mypic.jpg”]

    Thank you !
    S.

    Mehmet S.
    Keymaster

    Sorry, it not possible.

    steffonpixelwars
    Participant

    Hello, yes, it is ! I’ve found this Sunday. I have modified in functions.php :
    function slide( $atts, $content = null )
    {
    extract( shortcode_atts( array( ‘caption’ => ”, ‘url’ => ”, ‘src’ => ”, ‘target’ => ‘‘), $atts ) );

    $caption_out = ”;

    if ( $caption != ” ) { $caption_out = ” . $caption . ”; }

    $url_out_begin = ”;
    $url_out_end = ”;

    if ( $url != ” )
    {
    $url_out_begin = ‘<a href="' . $url . '" target=”‘ .$target. ‘“>’;
    $url_out_end = ‘‘;
    }

    $slide = ” . $url_out_begin . ” . $caption_out . $url_out_end . ”;

    return $slide;
    }

    add_shortcode( ‘slide’, ‘slide’ );

    And then, the code in my first message is ok !

    Mehmet S.
    Keymaster

    Ok. Good luck.

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘Responsy WP’ is closed to new topics and replies.