Tagged: mobile menu
-
AuthorPosts
-
May 7, 2015 at 11:25 am #440877
To get the mobile menu options, I followed your directions and amended my avia.js file, have I have added this to my enfold child theme functions.php:
avia_nav_menus(); function avia_nav_menus() { global $avia_config, $wp_customize; $avia_config[‘nav_menus’] = array( ‘avia’ => array(‘html’ => __(‘Main Menu’, ‘avia_framework’)), ‘avia2’ => array( ‘html’ => __(‘Secondary Menu <br/><small>(Will be displayed if you selected a header layout that supports a submenu here)</small>’, ‘avia_framework’), ‘plain’=> __(‘Secondary Menu – will be displayed if you selected a header layout that supports a submenu’, ‘avia_framework’)), ‘avia3’ => array( ‘html’ => __(‘Footer Menu <br/><small>(no dropdowns)</small>’, ‘avia_framework’), ‘plain’=> __(‘Footer Menu (no dropdowns)’, ‘avia_framework’)), ‘avia_responsive’ => array( ‘html’ => __(‘Responsive Menu <br /><small>(If set will replace your main menu on mobiles)</small>’)) ); add_theme_support(‘nav_menus’); foreach($avia_config[‘nav_menus’] as $key => $value) { $name = (!empty($value[‘plain’]) && !empty($wp_customize)) ? $value[‘plain’] : $value[‘html’]; register_nav_menu($key, THEMENAME.’ ‘.$name); } } add_action( ‘ava_after_main_menu’, ‘enfold_customization_add_responsive_menu’ ); function enfold_customization_add_responsive_menu() { echo “<nav style = ‘display:none;’ class=’main_menu_responsive’ data-selectname='”.__(‘Select a page’,’avia_framework’).”‘ “.avia_markup_helper(array(‘context’ => ‘nav’, ‘echo’ => false)).”>”; $avia_theme_location = ‘avia_responsive’; $avia_menu_class = $avia_theme_location . ‘-menu’; $args = array( ‘theme_location’ => $avia_theme_location, ‘menu_id’ => $avia_menu_class, ‘menu_class’ => ‘menu av-main-nav’, ‘container_class’ => $avia_menu_class.’ av-main-nav-wrap’.$icon_beside, ‘fallback_cb’ => false, ‘walker’ => new avia_responsive_mega_menu() ); wp_nav_menu($args); echo ‘</nav>’; }
function wp_change_aviajs() {
wp_dequeue_script( ‘avia-default’ );
wp_enqueue_script( ‘avia-default-child’, get_stylesheet_directory_uri().’/js/avia.js’, array(‘jquery’), 2, true );
}
add_action( ‘wp_print_scripts’, ‘wp_change_aviajs’, 100 );I have a couple questions:
1) I had made the changes to get the mobile menu options without adding that last section ( “function…100 ); ) to my child theme functions.php, and when I recently updated Enfold, I of course lost the changes to my avia.js (expected) but also lost the “avia_nav_menus();… echo ‘</nav>’; }” code from my child theme editor (not expected). I thought updates only affected the main enfold theme. The changes I made now are supposed to ensure that the mobile menus function even after an update without editing the avia.js file, right?2) Looking at my menu page now, I see a different naming convention at the bottom like this: http://imgur.com/Z2V6gmA. Is that how it’s supposed to look? I thought it used to be named “ENFOLD…”
Thanks for your help!
NancyMay 8, 2015 at 4:49 pm #441632Hey Munford!
1. That customization is not available in a child theme currently. We may see it get added to the framework in a future update though.
2. Not sure why it says THEMENAME there instead of Enfold. Perhaps it’s from your membership plugin? Try uploading a fresh copy of the theme and deactivate all plugins.
Regards,
ElliottMay 12, 2015 at 9:50 am #442876Hi Elliot –
I disabled my plugins and loaded a new version of enfold via ftp but am still seeing the THEMENAME instead of ENFOLD in the menu settings. I am using a child theme. Any ideas? It’s being flagged when I use WP-debug.
thanks
nMay 13, 2015 at 3:57 am #443493Hi!
Please post the login details here. We would like to check it. The mobile menu modification is not going to work on a child theme. You need to add it on the parent theme’s function.php.
Regards,
IsmaelMay 13, 2015 at 8:18 am #443597This reply has been marked as private.May 13, 2015 at 4:58 pm #443840Hey!
Can you please post the link to the topic where i provided you the code Nancy?
Best regards,
YigitMay 13, 2015 at 5:10 pm #443853May 18, 2015 at 1:20 pm #445606Hey Nancy!
Sorry for the late reply! Can you please show us the topic where you got the first part of the code and not the one that shows how to add avia.js file to child theme?
Regards,
YigitMay 18, 2015 at 1:26 pm #445609I think it was this:
#363311I think I also followed a link from a search on the support
May 21, 2015 at 2:35 pm #447742Hey!
please post a link instead of the #number, as we can’t find it otherwise.
Cheers!
AndyMay 21, 2015 at 3:44 pm #447771May 23, 2015 at 1:16 am #448781Hi Nancy!
What was the link to your site?
Regards,
JosueMay 23, 2015 at 7:10 am #448958This reply has been marked as private.May 26, 2015 at 8:14 am #449861Hey!
I tested the mobile menu modification on my installation and it works fine. It doesn’t change the theme location name so it’s either a third party plugin or a custom modification in your installation. Please try to deactivate all plugins then test it again. If you’ll give us your permission, we would like to deactivate the plugins to test which plugin is causing the issue. You can also edit this code:
register_nav_menu($key, THEMENAME.' '.$name);
Replace it with:
$theme_name = get_current_theme();register_nav_menu($key, $theme_name.' '.$name);
Cheers!
IsmaelMay 26, 2015 at 9:09 am #449893This reply has been marked as private.May 27, 2015 at 5:35 am #450412Hi!
The mobile menu is working. It doesn’t really affect anything on the site, it’s just that the child theme doesn’t recognize the THEMENAME constant. Did you try the solution provided above? https://kriesi.at/support/topic/mobile-menu-33/#post-449861
Cheers!
IsmaelJune 1, 2015 at 9:03 pm #452766This reply has been marked as private.June 3, 2015 at 8:50 am #453607Hey!
Keep a backup of everything, before you do, then go to your ftp, delete the old enfold and upload a new one.
Again, be sure to have a backup!
Best regards,
BasilisJune 3, 2015 at 10:22 am #453663OK I did that and now am getting an error on the site that says:
Broken Themes
The following themes are installed but incomplete. Themes must have a stylesheet and a template.
Name Description
Enfold Child The parent theme is missing. Please install the “enfold” parent theme.What do I do to fix this? I seem to have lost the child theme in the options: http://imgur.com/ICzvHc9
thanks…
NancyJune 5, 2015 at 10:11 am #455027Hi!
Can you please post us the childtheme style.css file header, so we can see that everything is correct?
Best regards,
BasilisJune 5, 2015 at 10:14 am #455028/*
Theme Name: Enfold Child
Description: A Child Theme for the Enfold WordPress Theme. If you plan to do a lot of file modifications we recommend to use this Theme instead of the original Theme. Updating will be much easier then.
Version: 1.0
Author: Kriesi
Author URI: http://kriesi.at
Template: enfold
*//*Add your own styles here:*/
/*.iconbox .iconbox_content .iconbox_content_title {
font-size: 40px!important;
}*/.iconbox {
opacity: 0.7;
}/*table styling itinerary*/
td {
border-bottom-color: #ffffff!important;
border-right-color: #ffffff!important;
border-top-color: #ffffff!important;
border-left-color: #ffffff!important;
}June 6, 2015 at 6:39 am #455393Hi!
Why did you override the theme? Like I said on my previous post, it doesn’t affect anything on the theme. Please review the post here: https://kriesi.at/support/topic/mobile-menu-33/#post-449861
You can find this line in the mobile menu modification:
register_nav_menu($key, THEMENAME.' '.$name);
Replace it with:
$theme_name = get_current_theme();register_nav_menu($key, $theme_name.' '.$name);
That should fix the theme name issue.
Cheers!
IsmaelJune 9, 2015 at 4:52 pm #456794thanks
-
AuthorPosts
- The topic ‘mobile menu’ is closed to new replies.