简体   繁体   English

如何在PHP代码中添加很棒的字体

[英]How to add font awesome into php code

I am working with the following php line of code 我正在使用以下php代码行

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

I am modifying a wordpress plugin and when called this line outputs the author and comment count of a post. 我正在修改一个wordpress插件,当被调用时,此行输出文章的作者和评论数。 I want to add the font awesome comment bubble (fa-comment "\\f075") after the | Comments: 我想在|后添加字体真棒注释气泡(fa-comment“ \\ f075”) | Comments: | Comments: part. | Comments:部分。

How can I do this? 我怎样才能做到这一点?

FYI I am a complete noob with php. 仅供参考,我是使用PHP的完整菜鸟。

The html for that icon is: 该图标的html是:

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

You can add it to the php code you have like this: 您可以像这样将其添加到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 );

您可以使用其HTML代码直接添加它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM