Hi there,
font awesome CSS is already enqueued by the theme as long as the option in
Appearance -> Customize -> Advanced options -> Front end icons (Font Awesome) -> Load Font Awesome resources
is active.
And on your site it is.
The thing is that Font Awesome 5 changed the way the CSS is defined, so you have to change your custom CSS to make it work with the FA latest version.
In particular, in your code above:
/* Add a magnifying glass in front of search box*/
.my-nav-menu-search .search-form:before {
font-family: 'FontAwesome';
content: '\f002';
position: absolute;
font-size: 19px;
font-weight: normal;
top: 5px;
left: 5px;
}
this: font-family: 'FontAwesome';
must become: font-family: 'FontAwesome 5 Free';
and the font-weight: font-weight: normal;
must become: font-weight: 900;
as the search icon in Font Awesome 5 (free) exists only in the Solid format, which is rendered with that font-weight only.
https://fontawesome.com/icons/search?style=solid
Hope this helps.
Thank you for your help Rocco. But still couldn’t see the search icon. I have no idea where did it go wrong. Already try clear cache and browse too.
Please check the result here: https://demo.tdstech.com/
Edited Code:
/* Add a magnifying glass in front of search box*/
.my-nav-menu-search .search-form:before {
font-family: ‘FontAwesome 5 Free’;
content: ‘\f002’;
position: absolute;
font-size: 19px;
font-weight: 900;
top: 5px;
left: 5px;
}
Hi,
Use the following for font family
font-family:'Font Awesome\ 5 Free';
I am able to get it to work on your website, by applying it via my developer tools.
View post on imgur.com
Thank you
Great! Work like a charm. Thank you Denzel and Rocco.
-
This reply was modified 8 years, 4 months ago by
taryarlwin.
Right,
thanks Denzel.
My mistake, was not
font-family: 'FontAwesome 5 Free';
but
font-family: 'Font Awesome 5 Free'; (I missed a space :/)
or
font-family: 'Font Awesome\ 5 Free'; (as Denzel said)
😀
Hi,
I am glad to be of some help. 🙂
Thank you!
I’m having this same issue on two sites (using identical code)
lifewithgremlins.com and Ketosee.com
/* Add a magnifying glass in front of search box*/
.my-nav-menu-search .search-form:before {
font-family: 'Font Awesome\ 5 Free';
content: '\f002';
position: absolute;
font-size: 19px;
font-weight: 900;
top: 5px;
left: 5px;
}
I have double checked and Font Awesome is enabled in advanced settings. Where am I going wrong?
-
This reply was modified 8 years, 3 months ago by
unwirklich.
-
This reply was modified 8 years, 3 months ago by
unwirklich.
-
This reply was modified 8 years, 3 months ago by
unwirklich.
I randomly thought to try it the ‘Font Awesome 5 Free’ way instead of ‘Font Awesome\ 5 Free’ and it works…which is odd, before it wouldn’t let me save without the \ though I can’t remember what the error said. Either way, problem solved 🙂