如何在 wordpress 中的 post 日期旁边添加字体真棒图标
How to add a font awesome icon next to the post date in wordpress
我正在尝试在我的 wordpress 主题中的 post 日期旁边添加一个很棒的字体图标。问题是我不知道如何添加以下行:
<i class="fa fa-clock-o" aria-hidden="true"></i>
我想我需要将以上行添加到
$time = '<time datetime=' . get_the_time('Y-m-d') . '>' . get_the_time('j F Y') . '</time>' ;
这样当我稍后在
中调用 $time
if ( is_home() ) {printf( $time);}
它在日期旁边显示图标。
有什么想法吗?
谢谢
您是否考虑过合并 html 和 php?
$time = '<i class="fa fa-clock-o" aria-hidden="true"></i>' . '<time datetime=' . get_the_time('Y-m-d') . '>' . get_the_time('j F Y') . '</time>'
您可以将图标放在任一侧。
我正在尝试在我的 wordpress 主题中的 post 日期旁边添加一个很棒的字体图标。问题是我不知道如何添加以下行:
<i class="fa fa-clock-o" aria-hidden="true"></i>
我想我需要将以上行添加到
$time = '<time datetime=' . get_the_time('Y-m-d') . '>' . get_the_time('j F Y') . '</time>' ;
这样当我稍后在
中调用 $timeif ( is_home() ) {printf( $time);}
它在日期旁边显示图标。
有什么想法吗? 谢谢
您是否考虑过合并 html 和 php?
$time = '<i class="fa fa-clock-o" aria-hidden="true"></i>' . '<time datetime=' . get_the_time('Y-m-d') . '>' . get_the_time('j F Y') . '</time>'
您可以将图标放在任一侧。