Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #481689

    I’m trying to change my mobile menu icon button and mobile menu icon close button (see attached screenshots for icons) I am trying to use custom icons that I uploaded to the site for each of these and not the standard icons. I am familiar with the article below and have used this method before but when I try it this way I get an error. I assume that the code has to be modified slightly to work in addition to changing the value of the icon. Can you please help me accomplish this? Thanks!

    http://kriesi.at/documentation/enfold/change-icon-used-for-standard-theme-elements/

    #482054

    Hey djshortkut!

    Thank you for using Enfold.

    What is the error that you get when you test the code? You can replace the code with this:

    add_action('init', function() {
    	global $avia_config;
    	$avia_config['font_icons']['close']['icon'] = 'ue824';
    	$avia_config['font_icons']['mobile_menu']['icon'] = 'ue824';
    	return $avia_config;
    });
    

    Adjust the icon value.

    Regards,
    Ismael

    #482247

    Thanks Ismael! I tried adding this code to the my child theme functions.php and got the error code below. I’m wondering if this has to do with the fact that I imported additional iconfonts through the uploader? It appears that the charcode of many of them was duplicated with the entypo-fontello charcodes when they were uploaded. Could this be the issue? For the menu open button I am trying to use font: lineicons /ue816 and for the close button font: lineicons2 /ue816 I’m trying to use iconfonts I uploaded and not the standard entypo-fontello fonts. I provided some temporary login credentials if you need to take a closer look. Thanks!

    Parse error: syntax error, unexpected ‘font_icons’ (T_STRING) in /home/content/p3nexnas05_data03/72/2104972/html/wp-content/themes/enfold-child/functions.php on line 61

    • This reply was modified 9 years, 4 months ago by djshortkut.
    #483239

    Hi!

    I can’t find the code from here in your child theme’s functions.php.
    I tried to put it into my own installation and it worked fine without any error messages. Let us know when you implemented the code correctly and still need help with it.

    Regards,
    Andy

    #483488

    I had to remove the code that Ismael provided above from my child theme’s functions.php because the parse error below shows up and the site goes down so I can’t leave it in since I need an operable site. Any idea why this error is showing up and what I can do to make this work? Since the new custom icons I uploaded also use the same charcodes and the entypo-fontello font, do I need to add something into the code that distinguishes what font is being used? Maybe that’s why I’m getting this error?

    I think if you can help me modify the code to show what font-family is being used then it might work?

    Open Button: font: lineicons /ue816
    Close Button: font: lineicons2 /ue816

    Parse error: syntax error, unexpected ‘font_icons’ (T_STRING) in /home/content/p3nexnas05_data03/72/2104972/html/wp-content/themes/enfold-child/functions.php on line 61

    • This reply was modified 9 years, 4 months ago by djshortkut.
    #484294

    Hi!

    Did you copy the code straight from your email? Please get the code directly from this forum. Make sure that the symbols are not converted to something else.

    Best regards,
    Ismael

    #484315

    No, I copied the code directly from this forum and the error code still came up. I tried this code on another installation of Enfold I have that does not have any custom fonts uploaded and it worked perfectly. I think it has to do with the charcodes being duplicated when the new fonts are added and the code not being able to determine which font-family the icon is coming from. I assume it’s normal that the charcodes icon value starts over every time a new font is added.

    #484951

    Hey!

    Try with this code:

    add_filter('avf_default_icons', function($icons) {
    	$icons['mobile_menu'] = array( 'font' =>'entypo-fontello', 'icon' => 'ue811');
    	return $icons;	
    }, 10, 1);
    

    Cheers!
    Josue

    #484996

    Thanks so much Josue! With a little bit of modification to the code I was able to get it to work correctly. You can close this thread.

    #485007

    You are welcome, glad to help :)

    Regards,
    Josue

    #485414

    You can close this thread

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Change Mobile Menu Icon’ is closed to new replies.