Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1273763

    Hi, I just tried to add a custom social icon in the header.

    As seen in your documentation I added this code in the functions.php:

    // Register new icon as a theme icon
    function avia_add_custom_icon($icons) {
    $icons['phone'] = array( 'font' =>'fontello', 'icon' => 'ue854');
    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['Phone'] = 'phone';
    return $icons;
    }
    add_filter('avf_social_icons_options','avia_add_custom_social_icon', 10, 1);

    Usually “ue854” should be a fontello phone icon, but there is a pencil showing instead. Whatever icon code I add, it’s still the pencil.

    What goes wrong?

    Best regards

    #1274049

    Hey Dirk,

    Please use the code as following

    
    // Register new icon as a theme icon
    function avia_add_custom_icon($icons) {
    $icons['phone'] = array( 'font' =>'entypo-fontello', 'icon' => 'ue854');
    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['Phone'] = 'phone';
    return $icons;
    }
    add_filter('avf_social_icons_options','avia_add_custom_social_icon', 10, 1);

    Font should be entypo-fontello instead of fontello :)

    Best regards,
    Yigit

    #1274332

    Hey Yigit,

    thanks a lot. It works like a charm now ;)
    You should change that in the documentation as well.

    Best regards,
    Dirk

    • This reply was modified 3 years, 2 months ago by diggital.
    #1274349

    Hey Dirk,

    You are welcome! :)

    We actually have following line in docs:

    Note: you may need to change “fontello” to the name of the imported font (you can check that in Enfold > Import/Export > Iconfont Manager

    Imported fonts may have different names so it is always better to check Iconfont Manager for font names. For default icons, it is “entypo-fontello” – https://imgur.com/a/MxrNMEu

    I will add a note for default icons, if you have any other suggestions, please let us know :)

    Best regards,
    Yigit

    #1274657

    Hey Yigit,

    that’s what I meant.
    Thanks for your support!

    Best regards,
    Dirk

    #1274659

    Hi Dirk,

    Thanks for your suggestion, I added following line to docs as well

    If you would like to add an icon from default font, please use “entypo-fontello” for “font”.

    Let us know if you have any other questions or issues and enjoy the rest of your day :)

    Best regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Customize Social Icons in Header’ is closed to new replies.