php - 如何将真棒字体添加到php代码中

标签 php css

我正在使用以下 php 代码行

$author = apply_filters( 'display_posts_shortcode_author', ' <span class="author">| ' . get_the_author() . ' | Comments: ' . get_comments_number() . '</span>', $original_atts );

我正在修改一个 wordpress 插件,调用此行时会输出帖子的作者和评论数。我想在 | 之后添加字体 awesome comment bubble (fa-comment "\f075")注释:部分。

我该怎么做?

仅供引用,我是 php 的完全菜鸟。

最佳答案

该图标的 html 是:

<i class="fa fa-comment" aria-hidden="true"></i>

您可以像这样将它添加到您的 php 代码中:

$author = apply_filters( 'display_posts_shortcode_author', ' <span class="author">| ' . get_the_author() . ' | Comments: <i class="fa fa-comment" aria-hidden="true"></i>' . get_comments_number() . '</span>', $original_atts );

关于php - 如何将真棒字体添加到php代码中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41203099/

相关文章:

php - 仅限制查询中的连接?

php - 查询结果为空

html - 即使将overflow-x设置为overlay,自定义水平滚动条仍然会向上推内容

html - 在链接上放置背景并使其具有可扩展性

php - 将多个图像从 MySQL 数据库拉取到 Android 设备的最有效方法

php - 删除好友脚本

php - Yii中如何正确使用和存储图片

html - 如何修复 ie 7 中的重叠?

CSS 表单 - 输入宽度不起作用

javascript - 使用特殊字符编码类样式属性