我正在使用以下 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/