New Landing How can we help? Atelier Override contact slideout icon in header

Viewing 6 posts - 1 through 6 (of 6 total)
  • Posted in: Atelier
  • #177205
    contemascetti
    Member
    Post count: 66

    Hi,

    I wanted to change the header contact slideout icon and I managed to do it editing sf-theme-overrides.php in:

    	// Header contact icon
    	function sf_atelier_header_contact_icon() {
    		return '<i class="fa-envelope-o"></i>';
    	}
    	add_filter('sf_header_contact_icon', 'sf_atelier_header_contact_icon');

    Problem is I cannot manage to insert this code properly in the child theme, where I want the change to be made. Nothing happens.

    Is there a particular syntax to use in the function child theme for this?

    thanks

    #177501
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Try the code below inside functions.php of the child theme.
    Change the HTML code returned.

    function sf_atelier_header_my_custom_contact_icon() {
    		return '<i class="sf-icon-contact"></i>';
    	}
    
    remove_filter('sf_header_contact_icon', 'sf_atelier_header_contact_icon');
    add_filter('sf_header_contact_icon', 'sf_atelier_header_my_custom_contact_icon');

    -Rui

    #177516
    contemascetti
    Member
    Post count: 66

    Hi,

    I tried the code you suggested but unfortunately the old icon is still displayed.

    function sf_atelier_header_my_custom_contact_icon() {
    		return '<i class="fa-envelope-o"></i>';
    	}
    
    remove_filter('sf_header_contact_icon', 'sf_atelier_header_contact_icon');
    add_filter('sf_header_contact_icon', 'sf_atelier_header_my_custom_contact_icon');

    Tried also with $hooks, include_once() and ! function_exists() parameters to no avail.

    I saw a few posts in the forums about the contact icon customization with no straightforward solution (other than editing the parent theme), it would be great if the developer could add a simple theme option to use the Font Awesome icon, a custom icon or some free text like mentioned in this Cardinal post:

    http://www.swiftideas.com/forums/topic/header-contact-slideout-icon-change-to-text-cardinal/

    thanks

    #177946
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi there,

    This is the code you want:

    function sf_atelier_header_my_custom_contact_icon() {
    return '<i class="fa-envelope-o"></i>';
    }
     
    add_filter('sf_header_contact_icon', 'sf_atelier_header_my_custom_contact_icon', 99);

    Hope that helps.

    – Ed

    #177972
    contemascetti
    Member
    Post count: 66

    Hi,

    that’s it.
    Simple and clean solution.

    I guess your secret weapon lies in that ’99’ I would never get by myself 🙂

    Many thanks for your help.

    #178215
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    No problem, thanks Ed

    – Kyle

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register