Community Forums › Forums › Archived Forums › General Discussion › Custom Theme – Secondary nav not visible?
Tagged: manu, secondary nav
- This topic has 3 replies, 3 voices, and was last updated 8 years, 8 months ago by Victor Font.
-
AuthorPosts
-
May 17, 2016 at 9:24 pm #185794homemadehooplahMember
I feel like I must be missing something obvious here (which is entirely possible, I'm still really green and learning as I go) but for the life of me I can't get the secondary navigation to load anywhere on my custom child theme.
I've quadruple checked that there's a menu tied to the secondary nav under Appearance, I've tried simply moving the second nav per the instructions here: https://my.studiopress.com/snippets/navigation-menus/, and I've tried being redundant and doing an add_theme_support for the second nav... but still nothing. The secondary nav is nowhere to be found.
This is what's currently in my theme's function.php (which currently has NO mention to any menu adjustments since everything I've tried so far as not worked). Is there anything in this code that would prohibit the secondary nav from showing up? Or is there something I should ADD to make the secondary navigation show up?
<?php /** * Theme Customization * * @package Hooplah * @author Chrisy Elliott * @link http://homemadehooplah.com * @copyright Copyright (c) 2015, Chrisy Elliott * @license GPL-2.0+ */ // Load child theme textdomain. load_child_theme_textdomain( 'hooplah' ); add_action( 'genesis_setup', 'hooplah_setup', 15 ); /** * Theme setup. * *Attach all of the site-wide functions to the correct hooks and filters. All the functions themselves are defined below this setup function. * * @since 4.0.0 */ function hooplah_setup() { // STANDARD - Define theme constants. define( 'CHILD_THEME_NAME', 'Hooplah' ); define( 'CHILD_THEME_URL', 'http://homemadehooplah.com' ); define( 'CHILD_THEME_VERSION', '4.0.0'); // STANDARD - Add HTML5 markup structure. add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) ); // STANDARD - Add viewpoint meta tag for mobile browsers. add_theme_support( 'genesis-responsive-viewport' ); // STANDARD - Add theme support for accessability. add_theme_support( 'genesis-accessibility', array( '404-page', 'drop-down-menu', 'headings', 'rems', 'search-form', 'skip-links', ) ); // STANDARD - Unregister other page layouts. genesis_unregister_layout( 'sidebar-content' ); genesis_unregister_layout( 'content-sidebar-sidebar' ); genesis_unregister_layout( 'sidebar-sidebar-content' ); genesis_unregister_layout( 'sidebar-content-sidebar' ); //* STANDARD - Unregister secondary sidebar unregister_sidebar( 'sidebar-alt' ); // STANDARD - Add theme widget areas. include_once( get_stylesheet_directory() . '/includes/widget-areas.php' ); // ADD - add theme support for both menus add_theme_support ( 'genesis-menus' , array ( 'primary' => __( 'Primary Navigation Menu', 'genesis' ), 'secondary' => __( 'Secondary Navigation Menu', 'genesis' ), ) ); // ADD - Add theme support for footer widgets. add_theme_support( 'genesis-footer-widgets', 3 ); } // FONTS - Adding Font Awesome stylesheet. add_action( 'wp_enqueue_scripts', 'hooplah_enqueue_styles'); function hooplah_enqueue_styles() { wp_enqueue_style ('font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css'); }
May 17, 2016 at 11:58 pm #185800Genesis DeveloperMemberAre you assigned a menu as Secondary navigation from Appearance -> Menus page?
May 18, 2016 at 9:00 am #185843homemadehooplahMemberHey there! Yes, there is a menu assigned under Appearance > Menus. And I've done as much troubleshooting as I can with it - removing and reattaching the menu, creating a new menu from scratch, and I even deleted the original menu to eliminate any problems with it (I'm designing the site on my PC with Bitnami and used an import from my live site to test with, and the old menu had an elaborate menu plugin that isn't on the test site, so I figured starting from absolute scratch couldn't hurt). I've also tried assigning the same menu to primary and secondary as well as assigning different menus to each, but still the secondary refuses to show.
So after all that, I'm still at a loss of what's keeping the secondary menu from showing. Even when I view the source on my page, the skeleton of the secondary nav *isn't* there, so I know it's not a CSS / styling issue that's keeping it hidden.
After two days of struggling with it I've decided to move on to a new navigation solution that doesn't require the secondary nav, but I'm still a little worried there might be a root cause or error within my theme that might rear it's head again as I'm working through the files. Are there any other troubleshooting steps I can go through to make sure everything is still a-okay?
May 18, 2016 at 11:45 am #185854Victor FontModeratorAre you building your own theme? You're going about it wrong. All you have to do is add theme support for nav and subnav structural wraps. Genesis takes care of the rest. This is a typical structural wrap declaration:
//* Add support for structural wraps add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'site-inner', 'footer-widgets', 'footer', ) );
Then you have to display it someplace.
add_action( 'genesis_after_header', 'genesis_do_subnav' );
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet? -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.