-
AuthorPosts
-
August 1, 2015 at 5:21 pm #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/
August 3, 2015 at 12:52 pm #482054Hey 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,
IsmaelAugust 3, 2015 at 4:48 pm #482247Thanks 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, 3 months ago by djshortkut.
August 5, 2015 at 11:57 am #483239Hi!
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,
AndyAugust 5, 2015 at 4:58 pm #483488I 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 /ue816Parse 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, 3 months ago by djshortkut.
August 7, 2015 at 6:37 am #484294Hi!
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,
IsmaelAugust 7, 2015 at 7:54 am #484315No, 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.
August 9, 2015 at 10:44 pm #484951Hey!
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!
JosueAugust 10, 2015 at 1:20 am #484996Thanks 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.
August 10, 2015 at 3:19 am #485007You are welcome, glad to help :)
Regards,
JosueAugust 10, 2015 at 4:01 pm #485414You can close this thread
-
AuthorPosts
- The topic ‘Change Mobile Menu Icon’ is closed to new replies.