If you want to load a subset of styles, instead of all.css, use the CDN Picker to select the styles you want, and then translate each resulting into a separate invocation of fa_custom_setup_cdn_webfont() in your functions.php. Then use the resulting href and integrity attributes to update the arguments to fa_custom_setup_cdn_webfont() in your functions.php. If you want to change the version you're loading in WordPress, go back to the CDN Picker and use it to select the new version. It's a security feature that tells the web browser how to verify that the file is exactly the expected file and has not been tampered with. The second argument corresponds to the integrity attribute from the CDN Picker. The first function argument corresponds to the href attribute from the element provided by the CDN Picker. */ if ( ! function_exists ( 'fa_custom_setup_cdn_svg' ) ) * This will load Font Awesome 5 from the Font Awesome Free or Pro CDN. Copy and paste this into your functions.php: You’ll only tweak the simpler code below to add your Kit token. You’ll probably never need to modify the code in this function. But if you aren't sure that you have such a use case on your hands, then that's a pretty good clue that setting up a kit is your best bet.įirst we’ll lay a foundation with this function that you’ll call with your Kit embed code. The "CDN" alternatives are offered because, sometimes, there are use cases where loading the Font Awesome assets directly from the CDN is preferable to loading a kit. Once you've set up a kit with one of these code snippets, you'll be able to configure and re-configure that kit right from your Font Awesome kit settings and not have to touch the PHP code again. In fact, kits are usually the best approach you can take for both performance and flexibility, especially Pro kits, especially especially SVG Pro kits. Kits are backed by a fast and stable CDN. So don't think that the kits approach in these examples is sans-CDN. Then we added kits, which are also backed by a CDN. Namely, before we had kits, the options were either to host the icon assets yourself (self-hosting), or load them from our Free or Pro CDN. ![]() The "without kits" approach is referred to as "CDN" in these examples mainly for legacy reasons. These examples and code snippets offer two different approaches to setting up Font Awesome in WordPress: with kits and without kits. I feel good about making some simple code changes to dial it in. ![]() I know how to make changes to my theme's functions.php file.I have write access to my WordPress theme's functions.php file. ![]() In order to make use of these code snippets, you need to be able to check off all of these boxes:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |