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 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大