dongsaoshuo4326 2016-12-17 21:09
浏览 49
已采纳

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

I am working with the following php line of code

$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. I want to add the font awesome comment bubble (fa-comment "\f075") after the | Comments: part.

How can I do this?

FYI I am a complete noob with php.

  • 写回答

2条回答 默认 最新

  • duandingcu7010 2016-12-17 21:15
    关注

    The html for that icon is:

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

    You can add it to the php code you have like this:

    $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 );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥30 自适应 LMS 算法实现 FIR 最佳维纳滤波器matlab方案
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动