douxiapi4381 2018-09-27 15:32
浏览 304

Font Awesome没有显示 - Avada主题(Wordpress) - 添加fa类

I migrated my wordpress site from a shared host to Digitalocean and everything went well except for the Font Awesome icons.

They are showing as blank squares on the live site.

I found the issue to be the required "fa" class for the icons is not showing up. I am using the Avada theme and am brand new to this.

1) I do not know where the CDN link is when I am searching through SFTP files. Can someone tell me where to find it so I can try to re-add the link.

2) Is there another way to automatically have the "fa" class to the icons so they will show up?

3) Any other insight into fixing the issue would be much appreciated.

  • 写回答

2条回答 默认 最新

  • duanboniao5903 2018-09-27 15:51
    关注

    Add this to your functions.php file:

    /**
     * Proper way to enqueue scripts and styles
     */
    function theme_name_scripts() 
    {
        // add this line
        wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css' );
        // Example styles and scripts
        wp_enqueue_style( 'style-name', get_stylesheet_uri() );
        wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true );
    }
    
    add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );
    

    alternatively you can add this code to your header.php file:

    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
    

    Let me know if this works or not.

    评论

报告相同问题?

悬赏问题

  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥50 汇编语言除法溢出问题
  • ¥65 C++实现删除N个数据列表共有的元素
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波