Here I am making my own theme and I want to add font-awesome external URL. I have created a file in my custom-theme directory in the path
app/design/frontend/vendor/theme_name/Magento_Theme/layout/default_head_blocks.xml.
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <head>
 <link rel="stylesheet" type="text/css" src="https://use.fontawesome.com/releases/v5.7.2/css/all.css"
 integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous" src_type="url" />
 </head>
</page>
I am following this link https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-manage.html
But after clearing the cache, I could not find the font-awesome link in the view source.
Please guide me. How to fix this issue?
1 Answer 1
Try This :-
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <head>
 <css src="https://use.fontawesome.com/releases/v5.7.2/css/all.css" type="text/css" src_type="url"/>
 </head>
</page>
Then run php bin/magento cache:flush
- 
 No. it is not working. Any other solution . @Ronak RathodMudasser Hayat– Mudasser Hayat2019年03月14日 08:39:56 +00:00Commented Mar 14, 2019 at 8:39
 - 
 In browser press ctrl + u and see your css load or not ?Ronak Rathod– Ronak Rathod2019年03月14日 08:44:54 +00:00Commented Mar 14, 2019 at 8:44
 - 
 Yes I did that my css load but font awesome was not loaded.Mudasser Hayat– Mudasser Hayat2019年03月14日 08:46:15 +00:00Commented Mar 14, 2019 at 8:46