Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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.

    View post on imgur.com

    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';

    View post on imgur.com

    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.

    #892513

    Hey 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,
    Yigit

    #892516

    Thanks 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.

    #892531

    Hi!

    Glad we could help :)

    I agree, we should make tutorial a bit more detailed. I noted it, we will be updating the post :)

    Let us know if you have any other questions or issues!

    Cheers!
    Yigit

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.