有两种方法可以做你想做的事。第一种方法是将此代码添加到函数中。联系人表单7插件的php:
add_filter( \'wpcf7_form_elements\', \'mycustom_wpcf7_form_elements\' );
function mycustom_wpcf7_form_elements( $form ) {
$form = do_shortcode( $form );
return $form;
}
这允许您将短代码直接放入CF7中。第二种方法是在联系人表单中使用HTML手动添加手风琴,如下所示:
<!-- begin class .wp-accordion -->
<div class="wp-accordion wpui-light">
<!-- First tab\'s panel -->
<h3 class="wp-tab-title">Tab 1</h3>
<!-- First tab\'s contents -->
<div class="wp-tab-content">
All the contents of first tab goes here....
</div><!-- end first tab -->
<!-- Like so, Second panel -->
<h3 class="wp-tab-title">Tab 2</h3>
<div class="wp-tab-content">
Contents of the second tab
</div>
</div><!-- end class wp-accordion -->
我认为第二种方法更可取,因为不需要修改核心插件文件。我希望这有帮助!