Community Forums › Forums › Archived Forums › Design Tips and Tricks › Questions about navigation repositioning and custom headers/hooks
- This topic has 1 reply, 2 voices, and was last updated 8 years, 11 months ago by Susan.
-
AuthorPosts
-
February 28, 2015 at 6:59 am #142643trashParticipant
Hello,
I have a few questions which where coming up while I enjoyed working with Genesis. I hope you guys can help me.I want to enable the user to upload a custom header image within the theme options. When I do that, Genesis creates an inline CSS code like the following on the fly and not in the CSS file: (can I prevent Genesis from doing this?)
background: url(http://wp1014318.server-he.de/page/wp-content/uploads/2015/02/my-logo.png) no-repeat !important;
My header image has a width and height of 140px, the page width is 1200px. When I now want to create a navigation bar including the logo which sticks to the top, the header is transparent and I have no chance to say that the background should be white, but the logo should be displayed as well.
So I created my own header function to overcome this:
echo '<header class="site-header" role="banner" itemscope="itemscope" itemtype="http://schema.org/WPHeader"> <div class="wrap"> <div class="title-area"> <a href="' . get_bloginfo( 'url' ) . '"> <img src="' . get_header_image() . '" title="' . get_bloginfo( 'name' ) . '" alt="' . get_bloginfo( 'name' ) . '" /> </a> <h1 class="site-title" itemprop="headline"> ' . get_bloginfo( 'name' ) . ' </h1> <p class="site-description" itemprop="description"> ' . get_bloginfo( 'description' ) . ' </p> </div> <!-- navigation --> </div></header>';
I now have three issues:
1. I assume this is not genesis friendly because I do not use any structural wraps?
2. I need to rename all CSS which is related to .site-header as the .site-header always has the background image which is created by genesis on the fly.
3. Additionally I want to include 2 navigation menus within the header, where I created the placeholder <!-- navigation -->How can I include two navigation menus here? I first thought to do it with an own hook like:
do_action('my_primary_menu'); remove_action( 'genesis_after_header', 'genesis_do_nav' ); add_action( 'my_primary_menu', 'genesis_do_nav' );
This leads to two more questions:
1. Are custom hooks like this "recommended to use" with Genesis?
2. How can I include the primary and secondary menus which are created by Genesis by default properly? If I use
wp_nav_menu( array( 'theme_location' => 'primary' ) );
the menu items are shown, but all the other necessary CSS classes are not been outputted in the HTML Code. I could now edit wp_nav_menu and include stuff for container, container_class, menu_class etc. but isn't there an easier way in Genesis without me having to analyze which CSS classes I need to enter here?Any feedback to my questions are really appreciated. Thanks, have a good weekend.
May 8, 2015 at 5:52 am #150886SusanModeratorAs you posted this a while ago, I hope you were able to get your issue resolved. If it is resolved, please mark this thread as “resolved”, so it can be closed.
If you are still having issues, report back here, and I will try to escalate.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.