wordpress显示摘要_如何在WordPress中突出显示作者的评论

wordpress显示摘要

On most sites, it is very hard for users to track author’s comments. This is why many WordPress sites highlight their author’s comment by making it a different background color, adding an image, etc. If you want to learn how to highlight author’s comments in WordPress, then you have come to the right place. In this article, we will show you the easiest and simplest way to highlight author’s comments in WordPress.

在大多数网站上,用户很难跟踪作者的评论。 这就是为什么许多WordPress网站通过将其作者背景更改为不同的背景色,添加图像等来突出其作者评论的原因。如果您想学习如何在WordPress中突出显示作者的评论,那么您来对地方了。 在本文中,我们将向您展示在WordPress中突出显示作者评论的最简单方法。

影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

WordPress by default generates a number of CSS classes which makes it easier for designers and users to change the styles (WordPress CSS Cheat Sheet). Among those default classes that WordPress has added, one of those are specifically targeted for styling author’s comments.

WordPress默认情况下会生成许多CSS类,这使设计人员和用户可以更轻松地更改样式( WordPress CSS备忘单 )。 在WordPress添加的默认类中,其中之一专门用于样式化作者的注释。

The class is called .bypostauthor which can be found in the .commentlist element. All you have to do is add your custom styles by using CSS. For example, you can add your own background, your own image, etc. Note: this code will be found in your style.css file located in your theme’s folder.

该类称为.bypostauthor,可以在.commentlist元素中找到。 您所要做的就是使用CSS添加自定义样式。 例如,您可以添加自己的背景,图像等。注意:此代码将在主题文件夹中的style.css文件中找到。


.commentlist .bypostauthor {}
.commentlist li ul.children li.bypostauthor {}

This doesn’t have to be super complex. Often it is a rather simple distinction that highlights author comment. For example, Chris Coyier has a border-top with a yellow/orange color that makes his comment stand out.

这不必是超级复杂的。 通常,这是一个相当简单的区别,突出了作者的评论。 例如,克里斯·科耶尔(Chris Coyier)的边框顶部是黄色/橙色,这使他的评论脱颖而出。

Highlight Author Chris

To get something like Chris, all you have to do is add this value in those classes:

要获得类似于Chris的东西,您要做的就是在这些类中添加以下值:


.commentlist .bypostauthor {border-top: 10px solid #e18728;}
.commentlist li ul.children li.bypostauthor {border-top: 10px solid #e18728;}

Note: we strongly recommend that you change the color to match your color scheme

:)

注意:我们强烈建议您更改颜色以匹配配色方案

Another example would be Matt Cutt’s site. He highlights his comment by adding a light background to his comment whereas all other comments have a white background.

另一个例子是Matt Cutt的网站。 他通过在评论中添加浅色背景来突出显示他的评论,而所有其他评论都具有白色背景。

Highlight Author Matt

You can do this by adding something like this in your style.css file:

您可以通过在style.css文件中添加如下内容来实现:


.commentlist .bypostauthor {background: #e7f8fb;}
.commentlist li ul.children li.bypostauthor {background: #e7f8fb;}

Again, we strongly recommend that you change the color to match your site’s color scheme.

再次,我们强烈建议您更改颜色以匹配站点的配色方案。

We hope that you find out tutorial on how to highlight author’s comment in WordPress to be helpful. The examples above are very simple, but you can go totally crazy and add background images, etc. Let us know if you have any questions.

我们希望您能找到有关如何在WordPress中突出显示作者评论的教程,以有所帮助。 上面的示例非常简单,但是您可能会发疯并添加背景图片等。如有任何问题,请告诉我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-highlight-authors-comments-in-wordpress/

wordpress显示摘要

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值