如何在WordPress中创建自定义评论样式?
WordPress 31
讲解如何使用WordPress代码自定义评论样式和布局的方法。
-
玖比肆 评论在WordPress中创建自定义评论样式可以通过以下步骤实现:
1. 打开主题的functions.php文件:使用FTP或者cPanel登录到您的WordPress主题文件夹,找到functions.php文件并打开。
2. 添加评论样式函数:在functions.php中添加以下代码,这将创建一个自定义评论样式的函数。
```php
function custom_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>- id="li-comment-">
'custom_comments')); ?>
```
这将告诉WordPress使用自定义评论样式而不是默认的样式。您可以根据需要进一步编辑和调整样式,并将其添加到您的CSS文件中。
2023年 5月 9日 上午4:48 - id="li-comment-">

comment_approved == '0') : ?>
__('Reply', 'textdomain'), 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>