好的,伙计,我抓住你了<你真的应该分成两个短代码。一个用作包装器(非常短),另一个用于内容。。。
Example:
add_shortcode(\'servicewrap\', \'service_wrapsc\');
function service_wrapsc($atts, $content = null) {
return \'<div class="service"><div class="container"><div class="row">\'.do_shortcode($content).\'</div></div></div>\';
}
add_shortcode(\'servicesingle\', \'service_singlesc\');
function service_singlesc($atts, $content = null) {
extract(shortcode_atts(array(
\'icon\' => \'fa-briefcase\'
), $atts));
return \'
<div class="col-md-3 col-sm-6">\';
<div class="service-icon wow animated fadeInDown" data-wow-delay="300ms"><i class="fa \'.$icon.\'"></i></div>
<div class="text wow animated fadeInUp" data-wow-delay="300ms">
<p>\'.do_shortcode($content).\'</p>
</div>
</div>\';
}
Than... You can do something like
[servicewrap]
[servicesingle icon=""]Your title here[/servicesingle]
[servicesingle icon=""]Your title here[/servicesingle]
[servicesingle icon=""]Your title here[/servicesingle]
[/servicewrap]