• Resolved precies

    (@precies)


    I have a small problem with the plugin and hard codes icons. If I use the plugin with a pro kit and create a page and load icons on it via acf, all icons on that page work. Also the icons that are hardcoded. But if I don’t use an icon field on a page template, then all hardcoded icons don’t work either. If I then load fontawsome locally, the icons via the plugin do not work again. How can I make my hardcoded icons work on pages where the ACF fontawsome plugin is not used?

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Matt Keys

    (@mattkeys)

    Hey @precies,

    When configuring your ACF FA field, if you have it set to enqueue FontAwesome, it will only do so when a field is being used. The thinking there was to prevent loading resources when they aren’t needed.

    However for people in your situation there is a filter that will tell this plugin to always enqueue regardless if a field is on the page. “ACFFA_always_enqueue_fa

    This could be used in your functions.php like below:

    add_filter( 'ACFFA_always_enqueue_fa', '__return_true' );

    Another alternative would be to set it to not enqueue fontawesome in the ACF field settings, and handle that yourself on the frontend. If you are using a kit, just make sure and load the same kit as you are using in the backend.

    Whatever you do just make sure only one instance of FontAwesome is being loaded the page at a time to avoid conflicts.

    Thread Starter precies

    (@precies)

    Hello Matte,

    Thanks for the quick response, this does exactly what I needed. the hardcoded icons are now also visible.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.