【发布时间】:2019-12-08 22:49:06
【问题描述】:
我想将我页面中的 acf 字段的输出与我的简码结合起来。文本应使用通过 acf 字段设置的颜色加下划线。
我尝试调用字段颜色并通过内联样式设置文本装饰。但这不起作用。任何想法我做错了什么?
function quote_func($atts, $content = null){
$color = get_field('color');
$output = '<div>';
$output .= '<span style="text-decoration-color:' . echo the_field('color'); . '">' . $content . '</span>';
$output .= '</div>';
return $output;
}
add_shortcode( 'quote', 'quote_func' );
【问题讨论】:
标签: html css wordpress shortcode