Hi there, I’m trying to get my shortcode button to open in a new window, the php for the button is below:
[php]function si_button( $atts, $content = null ) {
extract(shortcode_atts(array(
'url' => '#',
'new' => '#'
), $atts));
if ($new == "yes") {
$targ = " target='_blank'";
} else {
$targ = "";
}
return ‘<a href="’.$url.’" class=“btn”’.$targ.’>’ . do_shortcode($content) . ‘’;
}
add_shortcode( ‘button’, ‘si_button’ );[/php]
I’ve inserted:
[button url=http://envato.com/ target="_blank" ]Buy Now[/button]
in the iframe but its still not opening in a different window.
Can someone please help???
Thanks!