文章最后更新时间:

开始代码部署
定位:/wp-content/themes/zibll/inc/functions/zib-comments-list.php 文件,我们搜下面代码!
然后我们看上面的图片喜欢哪个一款直接替换我的整个函数代码,如下图我圈住的替换即可!

第一款
第一款没有样式,是直接跳转的,直接替换整个函数代码即可!
function zib_comment_filters($cont, $type = '', $lazy = true)
{
$cont = preg_replace_callback('/https?:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/', function($matches) {
return '<a href="' . $matches[0] . '" class="tuc-c602702c-41cfc1-0 comment-link tuc-c602702c-41cfc1-0" target="_blank">' . $matches[0] . '</a>';
}, $cont);
$cont = convert_smilies($cont);
$cont = preg_replace('/\[img=(.*?)\]/', '<img class="tuc-c602702c-41cfc1-0 box-img lazyload tuc-c602702c-41cfc1-0" src="$1" alt="评论图片' . zib_get_delimiter_blog_name() . '">', $cont);
if ('noimg' == $type) {
$cont = preg_replace('/\<img(.*?)\>/', '[图片]', $cont);
$cont = preg_replace('/\[code]([\s\S]*)\[\/code]/', '[代码]', $cont);
} else {
$cont = str_replace('[code]', '<pre><code>', $cont);
$cont = str_replace('[/code]', '</code></pre>', $cont);
}
$cont = preg_replace('/\[g=(.*?)\]/', '<img class="tuc-c602702c-41cfc1-0 smilie-icon tuc-c602702c-41cfc1-0" src="' . ZIB_TEMPLATE_DIRECTORY_URI . '/img/smilies/$1.gif" alt="表情[$1]' . zib_get_delimiter_blog_name() . '">', $cont);
if (zib_is_lazy('lazy_comment') && $lazy) {
$cont = str_replace(' src=', ' src="' . zib_get_lazy_thumb() . '" data-src=', $cont);
}
$cont = wp_kses_post($cont);
return $cont;
}
第二款
第二款是带有固定波浪的样式,不是动态的,一共两个代码,首先还是替换整个函数代码即可!
function zib_comment_filters($cont, $type = '', $lazy = true) {
$cont = convert_smilies($cont);
$cont = preg_replace('/\[img=(.*?)\]/', '<img class="tuc-c602702c-41cfc1-0 box-img lazyload tuc-c602702c-41cfc1-0" src="$1" alt="评论图片' . zib_get_delimiter_blog_name() . '">', $cont);
$pattern = '/(https?:\/\/[^\s]+)/i';
$replacement = '<a href="$1" target="_blank" class="tuc-c602702c-41cfc1-0 comment-link tuc-c602702c-41cfc1-0" style="color: var(--focus-color);">$1</a>';
$cont = preg_replace($pattern, $replacement, $cont);
if ('noimg' == $type) {
$cont = preg_replace('/\<img(.*?)\>/', '[图片]', $cont);
$cont = preg_replace('/\[code]([\s\S]*)\[\/code]/', '[代码]', $cont);
} else {
$cont = str_replace('[code]', '<pre><code>', $cont);
$cont = str_replace('[/code]', '</code></pre>', $cont);
}
$cont = preg_replace('/\[g=(.*?)\]/', '<img class="tuc-c602702c-41cfc1-0 smilie-icon tuc-c602702c-41cfc1-0" src="' . ZIB_TEMPLATE_DIRECTORY_URI . '/img/smilies/$1.gif" alt="表情[$1]' . zib_get_delimiter_blog_name() . '">', $cont);
if (zib_is_lazy('lazy_comment') && $lazy) {
$cont = str_replace(' src=', ' src="' . zib_get_lazy_thumb() . '" data-src=', $cont);
}
$cont = wp_kses_post($cont);
return $cont;
}
然后第二个代码放到:子比主题–>>自定义CSS样式即可!
© 版权声明
© 版权声明 All Rights Reserved
THE END







暂无评论内容