我正在学习如何制作 wordpress 主题。我做得很好。现在我想制作简码。但是在第 17 行的 E:\xampp\htdocs\wordpress\wp-content\themes\freedom\shortcodes.php 中显示 Parse error: syntax error, unexpected '}' 。我仍然不知道是什么问题。这是代码。
<?php
function slider_function( $atts ) {
$atts = extract( shortcode_atts(
array(
'tittle'=>'',
'description'=>'',
'button'=>'',
'button_url'=>''
),$atts ) );
return '
<div class="slider">
<h1>"' . $atts['tittle'] . '"</h1>
<h2>"' . $atts['tittle'] . '"</h2>
<a href="' . $atts['tittle'] . '" class="btn-modern text-center"></a>
</div>'
}
add_shortcode( 'slider','slider_function' );
?>