Community Forums › Forums › Archived Forums › Design Tips and Tricks › Custom Navigation and Header Area in Genesis Framework
- This topic has 7 replies, 3 voices, and was last updated 8 years, 8 months ago by roborracle.
-
AuthorPosts
-
October 30, 2013 at 2:35 pm #69983roborracleMember
I'm trying to customize the navigation and header region of my Genesis 2 theme. Here is the code I'm using:
/* Reposition the primary navigation menu remove_action( 'genesis_after_header', 'genesis_do_nav' ); function new_header(){ ?> <div id="title-area"> <div id="new-title"> <h1>new Title</h1> </div> <div id="new-nav"> <nav class="nav-primary" role="navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"><div class="wrap"> /* --------------------- below is the problem area -------------------------- <?php add_action( 'genesis_do_nav' ); ?> /* --------------------- end problem area -------------------------- </div> </nav> </div> <div id="new-search"> <p>Search Box will need to go in here</p> </div> </div> <?php } add_action( 'genesis_before_header', 'new_header' );
The title is printing out fine, and the paragraph where I will want to add my search box is printing fine too. HOwever, for some reason I am not getting any output for my menu.
What am I missing? THere is nothing being printed at all when I inspect the element.
Thanks in advance.
October 31, 2013 at 8:42 am #70113roborracleMemberanyone?
May 8, 2014 at 9:25 pm #104232fs_adminMemberHey, I am trying to solve the same issue... Did you find a solution?
Thank you
August 21, 2015 at 10:09 am #163082roborracleMemberNo, unfortunately I never found a solution to this. In fact, I'm back looking again for the solution for a new project.
August 21, 2015 at 2:04 pm #163093Brad DaltonParticipantAugust 24, 2015 at 11:04 am #163315roborracleMemberHi Brad - I'm simply trying to remodel the header area with the logo and main nav to be output in the same HTML region. The code above isn't really different than what I've got now.
Hi Brad - I'm simply trying to remodel the header area with the logo and main nav to be output in the same HTML region. The code above isn't really different than what I've got now.
function my_header(){ ?> <div id="title-area"><div class="wrap"?> <div id="my-title"> <h1><img src="http://mysite.com/mytheme/wp-content/themes/themename/images/logo.png" width="250" class="my-logo" title="<?php $bloginfo = get_bloginfo( $show, $filter ); echo $bloginfo; ?>" /></h1> </div> <div id="my-nav"> <nav class="nav-primary" role="navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> <div class="my-nav-wrap"> <!-- problem is right here - same as it was last time --> <?php add_action( 'genesis_do_nav' ); ?> <!-- everything else works --> </div> </nav> </div> </div> </div> <?php }
August 24, 2015 at 4:23 pm #163348Brad DaltonParticipantWhat you can do is add your logo to your nav menu? Would that be something you want to do?
August 25, 2015 at 8:47 am #163432roborracleMemberHi Brad - I got something figured out here. Here is what I ended up with:
remove_action( 'genesis_after_header', 'genesis_do_nav' ); // add_action( 'genesis_before_header', 'genesis_do_nav' ); remove_action( 'genesis_header', 'genesis_do_header' ); function mysite_header(){ ?> <div id="title-area"><div class="wrap"?> <div class="one-sixth first mysite-title"> <h1><a href="<?php bloginfo('url'); ?>"><img src="http://mysite.com/mysite/wp-content/themes/mysite_theme/images/mysite-logo.png" width="250" class="mysite-logo" title="<?php $bloginfo = get_bloginfo( $show, $filter ); echo $bloginfo; ?>" /></a></h1> </div> <div class="four-sixths mysite-nav"> <nav class="nav-primary" role="navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> <div class="mysite-nav-wrap nav-primary"> <?php wp_nav_menu( array( 'theme_location' => 'first-menu', 'container_class' => 'genesis-nav-menu' ) ); ?> </nav> </div> <div class="one-sixth mysite-contact-info"> <p><span class="contact-number">Call Us</span><br />XXX-XXX-XXXX</p> </div> </div> </div> <?php } add_action( 'genesis_header', 'mysite_header' );
That works well enough. I don't think it's ideal, or Genesis "proper". I think I may have found the start for the solution on your site, so thanks for that!
I'm really trying to get my head around the logic of how Genesis is put together, and I've not found a lot of resources for that unfortunately. I wish there was a course of some kind that taught you how to do this, instead of having to hack your way though things. If anyone knows of something like this, please let me know - maybe I'm missing something.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.