Archived topic
Fontawesome On Single Posts But Not Home
8 replies · Started by Jose on December 15, 2018
I added <i class="fa fa-twitter" aria-hidden="true"></i> to the menu but it only works on the single pages, but not the home page.
Hi there,
Can you try #1 here to eliminate any plugin conflicts first?
https://docs.generatepress.com/article/debugging-tips/
Let me know :)
Did #1 - didnt work...
How are you adding FA? Using this method?
https://docs.generatepress.com/article/font-awesome/
No... I thought it was inbuilt. Strange that its showing on other pages, may be pulling from our cdn cache previously.
So what you're saying is that by adding the following to an Element Header, we can incorporate it?
add_action( 'wp_enqueue_scripts', 'tu_load_font_awesome' );
/**
* Enqueue Font Awesome.
*/
function tu_load_font_awesome() {
wp_enqueue_style( 'font-awesome', '//use.fontawesome.com/releases/v5.5.0/css/all.css', array(), '5.5.0' );
}
Just added the code via Code Snippet plugin, but seems like a box is appearing now...
That adds Font Awesome 5, so you need to use the Font Awesome 5 class: https://fontawesome.com/icons/twitter?style=brands
<i class="fab fa-twitter"></i>
Ah ok! Got it... forgot about changing the code for the new font awesome. Thanks Tom!
And btw, I'm really finding GeneratePress amazing... your attention to detail is unbelievable. Case in point, on the menu drop down usage, whether to use click/hover... I have never seen so much thought gone into a product!
Thank you! Really appreciate it :)