• Resolved ngkenneth

    (@ngkenneth)


    Hi Matt,

    We were using this plugin to enqueue our font-awesome, even when we weren’t using FA in ACF fields, so we wouldn’t have to enqueue FA multiple times. Now on update, our sites are failing to load FA because that page isn’t using an icon in a field. Is there a way to filter the field conditional so FA can always be enqueued when the plugin is installed?

    Thank you

    • This topic was modified 7 years, 6 months ago by ngkenneth.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Matt Keys

    (@mattkeys)

    My plugin has always attempted to only enqueue FontAwesome if a field is using it on the page.

    Is it possible you were also using another plugin like Better Font Awesome to enqueue FontAwesome everywhere? Really curious how this was working for you in previous versions, let me know if you are able to figure that out.

    There is no filter to always enqueue FontAwesome in this plugin, but I will consider it for a future release.

    In the meantime if you have a need to always enqueue FontAwesome, I’d recommend that you disable the enqueue in your FontAwesome fields, and do it instead in your themes functions.php.

    If you are wanting to keep up with the latest version of FontAwesome (as this plugin does), you could enqueue this URL: https://cdn.jsdelivr.net/fontawesome/latest/css/font-awesome.min.css

    That is the same asset that this plugin uses.

    Thread Starter ngkenneth

    (@ngkenneth)

    Thanks so much, Matt. That’s a huge help. We tracked it down. We were relying on that library you included in the 1.0 version, the Better Font Awesome library.. which I guess was removed. We’re enqueuing directly now and patching with that plugin where we no longer have file access.

    Cheers

    Plugin Author Matt Keys

    (@mattkeys)

    Glad I could help. I will likely add a filter into the next release for people who want to use this plugin to enqueue FA everywhere as you were. I will try and post back here when that happens.

    Plugin Author Matt Keys

    (@mattkeys)

    This new filter was added just now in v2.0.4

    ACFFA_always_enqueue_fa: Return true to always enqueue FontAwesome on the frontend, even if no ACF FontAwesome fields are in use on the page. This will enqueue FontAwesome in the header instead of the footer.

    Here is an example of how you might use it (in functions.php):

    add_filter( 'ACFFA_always_enqueue_fa', '__return_true' );

    Thread Starter ngkenneth

    (@ngkenneth)

    Thank you, Matt!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Front-end enqueue’ is closed to new replies.