I tried to make my own shortcode for a first time. I have done all things and there is no syntax error. Can somebody tell me what's the mistake? It's not working.
I have implemented this code into function.php file and Dreamweaver tells me that there is no syntax error.
function booknovelist_button( $atts ) {
// Attributes
extract( shortcode_atts( array(
'style' => 'rfc',
'link' => 'www.booknovelist.com'
), $atts ) );
$style = '$atts[style]'; $choice = ' '; $choicehover = ' ';
if ($style == 'rfc') {
$choice='link to image';
$choicehover='link to image';
};
if ($style == 'sn') {
$choice='link to image';
$choicehover='link to image';
}
if ($style == 'pon') {
$choice='link to image';
$choicehover='link to image';
}
if ($style == 'amazon') {
$choice='link to image';
$choicehover='link to image';
}
echo '<div><a href="',$link,'"><img src="',$choice,'" onmouseover="this.src="',$choicehover,'"" onmouseout="this.src="',$choice,'""></a></div> ' ; }
}
add_shortcode ( 'bn_btn', 'booknovelist_button' );