Hi Rod,
i solved the problem by manually installing fontawesome in wordpress. Now the icons are shown in the menu again.
Thank you and best regards,
Oliver
Hi Rod,
i solved the problem by manually installing fontawesome in wordpress. Now the icons are shown in the menu again.
Thank you and best regards,
Oliver
So, hereās the function in the WP Theme that enqueues Font Awesome.
if ( !function_exists('font_awesome') ):
function font_awesome() {
// ...
}
endif;
add_action('wp_footer', 'font_awesome', 22);
In a child theme, you should be able to override this by creating your own āfont_awesomeā function, to wit:
function font_awesome() {
// echo your code for local Font Awesome resources.
}
add_action('wp_footer', 'font_awesome', 22);
I thought we had an article on child theming, but maybe that was an older version of the site or docs, or Iām imagining it. @rod_barbee, do you have any articles about it?
No. But I also think you might have had one way back when.
Matt, thank you!
Do I have to copy
if ( !function_exists('font_awesome') ):
function font_awesome() {
// ...
}
endif;
add_action('wp_footer', 'font_awesome', 22);
into the WP functions.php?
Best regards,
Oliver
The best way is to make a child theme. That way, when thereās a backlight update, it would not overwrite your changes. Looking at the source code, Matt already designed the Backlight theme to have a custom fontawesome loader This means that you donāt need to add anything to your themeās functions.php
file.
There are many tutorials out there to make a child theme. This one is from Wordpress: Create a Child Theme ā WordPress.com Support
As far as I remember, here are the minimal steps to create a child theme. The code shown is based on what Iām using on my site. Assuming your Backlight theme name is bl_theme
, I would call the child theme bl_theme_child
blog/wp-content/themes/bl_theme_child
. This assumes that the Wordpress installation is in /blog
, change this according to where you have WP installed.style.css
with following content:/*
Theme Name: Backlight Theme Child
Template: bl_theme
*/
functions.php
with following content<?php
function bl_theme_child_enqueue_styles() {
// Add local style
wp_enqueue_style('child-theme', get_stylesheet_directory_uri() .'/style.css', array('parent-theme'));
}
add_action( 'wp_enqueue_scripts', 'bl_theme_child_enqueue_styles' );
// Add font_awesome
function font_awesome() {
// echo your code for local Font Awesome resources.
}
add_action('wp_footer', 'font_awesome', 22);
?>
Obviously, you still need to add your local font awesome code.
This is what Iām basically using right now. Looking at some of the tutorials out there, there are many other options that might be of value. But this seems to work for me
Hope this helps!
Daniel,
thanks for your detailed explanation.
Best regards,
Oliver
Please let me know if it works for you!
Rod, I went to your page and followed the instructions for loading FA locally. I turned on the āLoad Font Awesome resources locallyā by selecting yes. Your page says Backlight will create a folder āfontawesomeā inside the backlight/custom/ folder. Is this only AFTER the new version is installed? Iām on framework 5.1.1 and when I did the above, it did not create the fontawsomefolder. Is this whole thread something I have to do when the new modules come out, and when they do come out, does font awesome pro (āfaā) have to be changed or will it continue to work as in the past? Also, I use a google font, āQuattrocento sansā that has a stylesheet link to
https://fonts.googleapis.com/css?family=Quattrocento|Quattrocento+Sans&display=swap
Is that a problem as well?
@michaelboatright Donāt worry about doing this right now. We have an update releasing soon that revamps Font Awesome to no longer use a CDN.
When I enabled that feature, the folder was created.
But Mattās about to release the update that will load Font Awesome 5 Free locally. In fact, the update removes the option to load locally, it just will be.
If using the far prefix, you may need to change it to fas.
More on that in this thread: Upcoming Changes to Font Awesome
Thanksā¦I read that. What about fa & fab? Quattrocento & Quattrocento+Sans?
I donāt know. Check the Font Awesome site to see if those are included in Font Awesome 5 free version.
OK, it was a bit of a dumb question. It looks like some far (fa-regular) icons, such as far fa-envelope are included in the free version as well as some fab (fa-brands): fab fa-instagram, fab fa-facebook, fab fa-linkedin and fab fa-youtube that I use.
Backlight 5.2.0 is now live.
I just noticed in my Backlight WordPress theme pages, the Font Awesome use in the parent menu is showing [?] instead of the \f107.
Yet when I go to a Backlight photo page (published via Lightroom), those pages do have the right icon. Itās only the pages in the WordPress theme that are broken.
More crazy, when Iām logged into my siteās WordPress backend the menu icon is shown correctly. Itās only when not logged in.
I searched around trying to sort this out and just gave up. So here I am, asking the group.
Why does the WordPress theme pages for Backlight 5.0.3 have the broken Font Awesome in the menu?
Iāve updated all the modules, which are mostly 5.4.0. My photo pages are a mix of Pangolin modules 5.0.1, 5.0.7, 5.3.0 (thatās what I get after the update).
you can find what Iām seeing at reekes.net (try Home and then Photography). Works under Photography which are Pangolin pages. Itās broken under all other pages, which are Backlight WP Theme pages.
Hi Jim,
Are you using the latest version?
The Turning Gateās blog includes the FontAwesome CSS:
<link rel="stylesheet" id="fontawesome5free-css" href="https://backlight.theturninggate.net/backlight/modules/module-admin/lib/css/all.min.css?ver=6.2.3" type="text/css" media="all">
However, Iām not seeing that asset in your page source. Did you replace the HEAD section of the page with your own?
I also notice a missing icon in your albums in the large image display. The image menu icon in the upper right shows the unicode rather than the image icon.
have you tried clearing template cache?
I had a similar issue with WordPress sites not long ago. Turned out that I was using a different site url in the WordPress settings than what my Backlight site url was set to.
(mainly the difference between the subdomain url and the simpler url I assigned: ttg-tips.barbeephoto.com vs ttg-tips.com, for example) or my main site, which can be reached at barbeephoto.com or rodbarbee.com.
Anyway, I needed to reconcile those.
So Iām wondering if your Backlight site URL exactly matches the Site Address URL in WordPress general settings. e.g. http:// vs https://
Are you using the latest version?
Thereās no option to update the modules, so Iām assuming I do have the latest. I noticed the problem after updating a couple days ago. Hereās the main modules and versionsā¦
module-framework 5.4.0
module-admin 5.4.0
module-designer 5.4.0
module-publisher 7.4.0
module-pages 5.0.2
custom-resources 5.3.3
pangolin-wordpress 5.0.3
Iāve tried clearing the cache and exporting the them to WP.
Turning Gateās blog includes the FontAwesome CSS
No idea whatās going on there. I think this is the root cause.
Did you replace the HEAD section of the page with your own?
Nope. Itās all entirely being created by Backlight. I havenāt changed anything within WP (not that I can recall). Searching through all the settings in both BL and WP I donāt see how/why thereās a problem.
menu icon in the upper right shows the unicode rather than the image icon
Where? I canāt find this one. I only see this problem on the WP theme pages, not in the BL photo pages.
Backlight site URL exactly matches the Site Address URL in WordPress
Theyāre the same, and that hasnāt changed in years.
In Backlight the WP theme advanced option for āFont Awesome Version Supportā is set to true. I also tried false (then flush/export), but it didnāt change anything. I even added flushing my siteās cache after the change.
My siteās functions.php only enqueue the BL styles for the chile theme. I also try activating the BL theme directly.
I found another problem with FontAwesome at the bottom of Jim Reekes RĆ©sumĆ© | Jim Reekes. The 3 buttons used to have icons, but only 1 does now. Thereās a ::before for the button text that was inserting an icon, but thatās also broken? I think thatās another issue about FontAwesome I donāt understand.
The only real change thatās happened in years is updating BL. I suspect I missed this change some time ago (last year?). All the caching in browsers, servers, ā¦ and I probably missed it. Just noticed it the other way when I did an BL update.
PS ā hmm, seems like the site isnāt getting CSS files. In BL I created a jim-style.css but donāt find it being copied to the WP Theme. Also sounds like what Matt pointed out about the missing FontAwesome CSS file.
This is a strange clue. When Iām logged into WP the CSS files are there. But when I log out, or use a private browsing window, the CSS is missing. Chrome security biting me?
Hmm, do I need to setup a free account at FontAwesome, and then download their kit, and so on and so on? I tried following what they are saying about getting fonts but I got lost. I havenāt been paying attention to them, but it seems they completely changed their world.
Do I need to use their plugin, add scripts or something? I only have a few icons Iām using.