[英]Font Awesome not Displaying
Any pointers please why Font Awesome icons are not displaying on my Wordpress site when I put them inside a php function? 任何指针,当我将它们放入php函数时,为什么“真棒字体”图标未显示在我的Wordpress网站上?
<div class="navigation pull-right">
<?php
previous_post_link('%link', "<i class='fa fa-chevron-right'></i>" );
echo ' ';
They display fine on my site when not in php... 当不在php中时,它们在我的网站上显示良好。
Put this in your head tag 放在你的头标签
<head>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
</head>
Make changes in header.php file 在header.php文件中进行更改
<?php
//* Do NOT include the opening php tag
//* Load Font Awesome
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' );
}
也许更改引号会有帮助,例如:
previous_post_link("%link", '<i class="fa fa-chevron-right"></i>');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.