<cite class="fn"></cite>
<span class="say"></span>
但是,除非我加入一些div安排,否则我无法将HTML设计实现到我的WordPress评论系统中→<div class="some-class">
<cite class="fn"></cite>
<span class="say"></span>
</div>
我相信一定有某种方法可以做到这一点(修改核心评论表单HTML)。<cite class="fn"></cite>
<span class="say"></span>
但是,除非我加入一些div安排,否则我无法将HTML设计实现到我的WordPress评论系统中→<div class="some-class">
<cite class="fn"></cite>
<span class="say"></span>
</div>
我相信一定有某种方法可以做到这一点(修改核心评论表单HTML)。您可以为注释列表编写自己的自定义HTML结构。在您的comments.php
文件,将调用wp_list_comments()
作用找到它,并将自己的函数作为其回调传递:
wp_list_comments( array( \'callback\' => \'my_function\' ) );
现在,创建一个回调函数并开始实现您自己的HTML结构。此函数接受3个参数。以下是一个基本示例:my_function( $comment, $args, $depth ){
$GLOBALS[\'comment\'] = $comment;
// You have access to comment\'s ID and other
// comment query methods here, such as comment_ID();
}
我正在尝试将其添加到函数中。php。在我的另一个站点上的测试实验室中,它可以很好地添加测试信息。但在这个网站上,我试图把它添加到什么都没有发生的情况下。该网站正在使用最新的woocommerce运行一个建筑节俭主题。有什么想法吗?我基本上只是想在每个产品页面上添加一行类似于免责声明但无法添加的文本。add_action(\'woocommerce_before_add_to_cart_form\',\'print_something_below_short_description\');