Tagged: custom, icon list, php, social icons
-
AuthorPosts
-
January 2, 2018 at 1:15 pm #892465
Hi,
first of all, Happy new Year to you all and thanks for your support through 2017.
I’ve created and installed the icon font I want to use in the header to replace the supplied LinkedIn icon. It is now showing in my list under Fontello if I try using the Icon Box so we know it is installed correctly – see screenshot below.
I’ve run through the instructions in the documentation at: How to Add Custom Social Icons to the Theme Options but it doesn’t show in the header.
The code I have added to functions.php is:
// Import Fonts // Register new icon as a theme icon function avia_add_custom_icon($icons) { $icons['icon_name'] = array( 'font' =>'fontello', 'icon' => 'ue800'); return $icons; } add_filter('avf_default_icons','avia_add_custom_icon', 10, 1); // Add new icon as an option for social icons function avia_add_custom_social_icon($icons) { $icons['Icon Label'] = 'icon_name'; return $icons; } add_filter('avf_social_icons_options','avia_add_custom_social_icon', 10, 1);
The Icon is listed in Social Profiles > Social Icons but only as “Icon Label” so it’s not picking the name up from
$icons['Icon Label'] = 'icon_name';
I’ve tried changing the ‘icon_name’ to icon-linkedin-square or just linkedin-square but $icons still shows as icon Label in the list.
Obv I’m being a bit dim here and would appreciate a bit of guidance.
Many thanks.
- This topic was modified 6 years, 11 months ago by DigitalEssence.
January 2, 2018 at 4:49 pm #892513Hey DigitalEssence,
Thanks! Happy new year to you as well :)
I changed the code to following and it worked
function avia_add_custom_icon($icons) { $icons['linkedin_square'] = array( 'font' =>'fontello', 'icon' => 'uf31b'); return $icons; } add_filter('avf_default_icons','avia_add_custom_icon', 10, 1); // Add new icon as an option for social icons function avia_add_custom_social_icon($icons) { $icons['LinkedIn '] = 'linkedin_square'; return $icons; } add_filter('avf_social_icons_options','avia_add_custom_social_icon', 10, 1);
Please note the space after icon label. It did not work before as there was already another icon named “LinkedIn”. Please review your website :)
Best regards,
YigitJanuary 2, 2018 at 4:55 pm #892516Thanks Yigit,
That’s it working now.
I had made all of those changes (apart from the space in the Icon Label) individually but not all at the same time.
Perhaps the docs need a note about changing these variables as I thought they’d be picked up from the font file zip. Unless it’s perfectly obvious to everyone but myself. Blush
thanks again.
January 2, 2018 at 6:03 pm #892531 -
AuthorPosts
- You must be logged in to reply to this topic.