After 4.0 upgrade responsive menu button not working
-
In responsive mode the menu button is not working after the 4.0 upgrade. I’ve deactivated all my plugins and that didn’t help. I am showing no errors in the console. The problem can be viewed at legacytraditional.org
-
What’s in your Child Theme functions.php file?
I have a custom post-type for the slideshow and custom sidebar widgets. here is the code:
<?php // Register Custom Post Type function homepage_slider() { $labels = array( 'name' => _x( 'Slides', 'Post Type General Name', 'text_domain' ), 'singular_name' => _x( 'Slide', 'Post Type Singular Name', 'text_domain' ), 'menu_name' => __( 'Banner', 'text_domain' ), 'parent_item_colon' => __( 'Parent Slide:', 'text_domain' ), 'all_items' => __( 'All Slides', 'text_domain' ), 'view_item' => __( 'View Slide', 'text_domain' ), 'add_new_item' => __( 'Add New Slide', 'text_domain' ), 'add_new' => __( 'New Slide', 'text_domain' ), 'edit_item' => __( 'Edit Slide', 'text_domain' ), 'update_item' => __( 'Update Slide', 'text_domain' ), 'search_items' => __( 'Search slides', 'text_domain' ), 'not_found' => __( 'No slides found', 'text_domain' ), 'not_found_in_trash' => __( 'No slides found in Trash', 'text_domain' ), ); $args = array( 'label' => __( 'homepage_slider', 'text_domain' ), 'description' => __( 'Homepage Slides', 'text_domain' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'custom-fields' ), 'taxonomies' => array( 'category', 'post_tag' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'show_in_admin_bar' => true, 'menu_position' => 5, 'menu_icon' => '', 'can_export' => false, 'has_archive' => false, 'exclude_from_search' => true, 'publicly_queryable' => true, 'capability_type' => 'post', ); register_post_type( 'homepage_slider', $args ); } // Hook into the 'init' action add_action( 'init', 'homepage_slider', 0 ); //Add Featured Image Function add_theme_support( 'post-thumbnails' ); //Add additional generated image sizes add_image_size( 'homepage-slide', 932, 401, true ); //(cropped) //Make shortcode readable in widgets add_filter('widget_text', 'do_shortcode'); //Add custom sidebar widgets function charterschool_widgets_init() { register_sidebar( array( 'name' => __( 'Directory Sidebar', 'charterschool' ), 'id' => 'sidebar-4', 'description' => __( 'This is the sidebar for the district direcory.', 'charterschool' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' =>__( 'Misc Sidebar', 'charterschool'), 'id' => 'sidebar-5', 'description' => __( 'This sidebar can be used when needed', 'charterschool' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } add_action( 'widgets_init', 'charterschool_widgets_init' ); ?>
Does the same error occur on your parent theme?
I hadn’t thought of that. When I switch to the 2012 theme it works. I even reactivated the plugins and it was fine. So it has something to do with the child theme. It sounds like you thought it was php causing the issue. Can you help me narrow down the cause? I always assumed the responsive menu was being generated by just CSS?
What other files are in your Child Theme?
footer.php, page.php, header.php, functions.php, nivo slider folder, a couple of custom pages and style.css
I will start with the custom CSS then pull the php files out one at a time to debug. Thanks for your help, I won’t be available again till Saturday morning. I should be able to resolve this topic then.
Can you post here the code in your header.php file, and footer.php file?
Check for difference in header.php between current version of 2012 and your child theme.
Current version menu button is a button
<button class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></button>
Previous version it was a h3
<h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
New version references button in js/navigation.js
Previous version references h3 in js/navigation.js
Solution
Change h3 to a button in your child theme header.phpThank you wallyO! That was the issue. I replaced the line in the child-theme’s header.php file and it’s working again!
Problem solved.
Resolved.
- The topic ‘After 4.0 upgrade responsive menu button not working’ is closed to new replies.