• Resolved Functional Post

    (@functionalpost)


    I have created my own custom icons for use and have replaced Font Awesome icons with those but the Font Awesome icons still make a http request which negatively affects page load speed. I do not wish to delete or rename or alter in any way the ‘fa’ folder of the theme. I use a child theme. How do I dequeue font awesome icons using child theme’s functions.php?

Viewing 10 replies - 16 through 25 (of 25 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try dequeue_style instead of dequeue_script;

    wp_dequeue_style( $handle )

    Ahhh, I didn’t notice it was a CSS file. Damn, it!! Thank you, Andrew. I’m going to flush myself. -_-

    Thread Starter Functional Post

    (@functionalpost)

    no. I do not wish to dequeue the stylesheet because the custom icons I’m using are implemented using .fa fw fa-whatever:before{};. So without the stylesheet the icons would be all out of place.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Are you saying you’ve modified the theme’s files?

    Thread Starter Functional Post

    (@functionalpost)

    The only way I can be helped is if some expert enter my parent theme’s functions.php and remove the codes to prevent enqueuing and registering of Font Awesome icons altogether. But that would be asking too much from that person. So, thank you again for your time and efforts. I’m grateful.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    How do I dequeue font awesome icons using child theme’s functions.php?

    I do not wish to dequeue the stylesheet

    They are two completely conflicting goals.

    If you have modified the theme’s font stylesheet, remove your modifications and transfer them to your Child Theme style.css file. Then dequeue the parent theme stylesheet as we’ve instructed.

    If you don’t want to dequeue the parent theme font then I assume you have a misunderstanding of how this font works. This font is a CSS file, which holds the icons. The icons are not actual image files, the icons are generated from the CSS.

    Thread Starter Functional Post

    (@functionalpost)

    Nope Andrew. I did it in my child theme’s stylesheet.

    Thread Starter Functional Post

    (@functionalpost)

    Sorry I probably confused you Andrew. .fa-whatever:before{content=""; background=url("...")} replaces the FA icon but since it has the .fa class, its styling is determined by the stylesheet located in rowling>fa>css which is why I cannot dequeue the stylesheet.

    Thread Starter Functional Post

    (@functionalpost)

    Ok thanks Andrew. I think I can do that.

    Thread Starter Functional Post

    (@functionalpost)

    Therefore, as a good and responsible WordPress support user, I must mark this topic resolved.

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘How to wp_dequeue_style font awesome icons?’ is closed to new replies.