第二款是带有固定波浪的样式,不是动态的,一共两个代码,首先还是替换整个函数代码即可!
- function zib_comment_filters($cont, $type = '', $lazy = true) {
- $cont = convert_smilies($cont);
- $cont = preg_replace('/\[img=(.*?)\]/', '<img class="box-img lazyload" src="$1" alt="评论图片' . zib_get_delimiter_blog_name() . '">', $cont);
- $pattern = '/(https?:\/\/[^\s]+)/i';
- $replacement = '<a href="$1" target="_blank" class="comment-link" 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></pre>', $cont);
}
$cont = preg_replace('/\[g=(.*?)\]/', '<img class="smilie-icon" 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;
}[/code]然后第二个代码放到:子比主题–>>自定义CSS样式即可!
- /* 评论链接波浪线样式 */
- .comment-link {
- -webkit-box-decoration-break: clone;
- box-decoration-break: clone;
- text-decoration: underline wavy !important;
- text-decoration-thickness: from-font;
- text-underline-offset: 3px;
- }
- .navbar-top li.current-menu-item>a,
- .navbar-top li:hover>a {
- -webkit-box-decoration-break: clone;
- box-decoration-break: clone;
- text-decoration: underline wavy;
- text-decoration-thickness: from-font;
- text-underline-offset: 3px;
- }
复制代码