-
AuthorPosts
-
April 18, 2018 at 3:28 pm #943637
Hello,
I was wondering if it is possible on the mobile view to have a phone icon that would display to the left on the burger icon.
Thanks!
April 20, 2018 at 4:10 am #944398Hey Pappasdg,
Thank you for using Enfold.
Yes, this is possible. Use the “wp_nav_menu_items” filter to append more items to the menu.
/* Phone Icon */ if(!function_exists('avia_append_phone_icon')) { //first append search item to main menu add_filter( 'wp_nav_menu_items', 'avia_append_phone_icon', 9997, 2 ); add_filter( 'avf_fallback_menu_items', 'avia_append_phone_icon', 9997, 2 ); function avia_append_phone_icon( $items, $args ) { if ((is_object($args) && $args->theme_location == 'avia') || (is_string($args) && $args = "fallback_menu")) { $items .= '<li id="menu-item-phone" class="noMobile menu-item menu-phone menu-item-avia-special"> <a href="#" '.av_icon_string('phone').'><span class="avia_hidden_link_text">'.__('Phone','avia_framework').'</span></a> </li>'; } return $items; } } function avf_default_icons_mod($icons) { $icons['phone'] = array( 'font' =>'entypo-fontello', 'icon' => 'ue854'); return $icons; } add_filter('avf_default_icons','avf_default_icons_mod', 10, 1);
This code is based on the ajax search icon.
Best regards,
IsmaelSeptember 27, 2019 at 11:53 pm #1142932I’ve tried this, but for some reason doesn’t seem to work. Am I doing something wrong?
September 30, 2019 at 4:46 am #1143211August 25, 2020 at 2:08 pm #1240660hi!
could you explain how would you have to modify this code to show the icon on desktop AND mobile?
thank you!
chris
August 28, 2020 at 1:04 pm #1241565Hi,
Please try this function instead:if(!function_exists('avia_append_phone_icon')) { //first append search item to main menu add_filter( 'wp_nav_menu_items', 'avia_append_phone_icon', 9997, 2 ); add_filter( 'avf_fallback_menu_items', 'avia_append_phone_icon', 9997, 2 ); function avia_append_phone_icon( $items, $args ) { if ((is_object($args) && $args->theme_location == 'avia')) { $items .= '<li id="menu-item-phone" class="noMobile menu-item menu-phone menu-item-avia-special"> <a href="#" '.av_icon_string('phone').'><span class="avia_hidden_link_text">'.__('Phone','avia_framework').'</span></a> </li>'; } return $items; } } function avf_default_icons_mod($icons) { $icons['phone'] = array( 'font' =>'entypo-fontello', 'icon' => 'ue854'); return $icons; } add_filter('avf_default_icons','avf_default_icons_mod', 10, 1);
Best regards,
MikeAugust 28, 2020 at 3:33 pm #1241613hi!
thanks but the icon isn’t showing… ;-(
regards,
chris
August 29, 2020 at 8:10 pm #1241847Hi,
Thank you for the login, I added this css in your Quick CSS:.html_burger_menu_active #header .avia-menu #menu-item-phone { display: block !important; } #menu-item-phone a:before { font-size: 35px; }
Please adjust the font to suit, if needed, and then clear your browser cache and any cache plugin, and check.
Best regards,
MikeAugust 30, 2020 at 11:50 am #1241889thanks alot, this works great.
have a nice sunday!
August 30, 2020 at 12:17 pm #1241896Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Add Phone Icon Next Burger Menu Icon on Mobile’ is closed to new replies.