Community Forums › Forums › Archived Forums › Design Tips and Tricks › Can't get the Navigation to work above header
Tagged: moving navigation menus
- This topic has 3 replies, 2 voices, and was last updated 11 years, 9 months ago by
Doug.
-
AuthorPosts
-
April 18, 2013 at 5:17 pm #36241
Doug
MemberHello, I can't get the sub-navigation to work (you can't see the sub-nav pages) above the header; I've put in the code like Nick told me; but, it's still not working:
<code>/** Reposition the primary navigation */
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before', 'genesis_do_nav' );</code>I can't get the child pages to show under the parent pages. Can anyone help?
Here's the code in its entirety:
<code><?php
/** Start the engine */
require_once( get_template_directory() . '/lib/init.php' );/** Child theme (do not remove) */
define( 'CHILD_THEME_NAME', 'Magazine Theme' );
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/magazine' );/** Add Viewport meta tag for mobile browsers */
add_action( 'genesis_meta', 'magazine_add_viewport_meta_tag' );
function magazine_add_viewport_meta_tag() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
}/** Create additional color style options */
add_theme_support( 'genesis-style-selector', array(
'magazine-blue' => 'Blue',
'magazine-green' => 'Green',
'magazine-orange' => 'Orange',
'magazine-purple' => 'Purple',
'magazine-red' => 'Red',
'magazine-teal' => 'Teal'
) );$content_width = apply_filters( 'content_width', 610, 460, 910 );
/** Add support for structural wraps */
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'inner',
'footer-widgets',
'footer'
) );
add_theme_support( 'genesis-connect-woocommerce' );/** Add new image sizes */
add_image_size( 'home-bottom', 280, 150, TRUE );
add_image_size( 'slider', 600, 250, TRUE );
add_image_size( 'square', 120, 120, TRUE );
add_image_size( 'tabs', 580, 250, TRUE );/** Add support for custom header */
add_theme_support( 'genesis-custom-header', array(
'width' => 960,
'height' => 200
) );/** Add support for custom background */
add_theme_support( 'custom-background' );/** Reposition the primary navigation */
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before', 'genesis_do_nav' );/** Add after post ad section */
add_action( 'genesis_after_post_content', 'magazine_after_post_ad', 9 );
function magazine_after_post_ad() {
if ( is_single() && is_active_sidebar( 'after-post-ad' ) ) {
echo '<div class="after-post-ad">';
dynamic_sidebar( 'after-post-ad' );
echo '</div><!-- end .after-post-ad -->';
}
}/** Add after content ad section */
add_action( 'genesis_before_footer', 'magazine_after_content_ad' );
function magazine_after_content_ad() {
if ( is_active_sidebar( 'after-content-ad' ) ) {
echo '<div class="after-content-ad">';
dynamic_sidebar( 'after-content-ad' );
echo '</div><!-- end .after-content-ad -->';
}
}/** Add support for 3-column footer widgets */
add_theme_support( 'genesis-footer-widgets', 3 );/** Register widget areas */
genesis_register_sidebar( array(
'id' => 'home-top',
'name' => __( 'Home Top', 'magazine' ),
'description' => __( 'This is the home top section.', 'magazine' ),
) );
genesis_register_sidebar( array(
'id' => 'home-left',
'name' => __( 'Home Left', 'magazine' ),
'description' => __( 'This is the home left section.', 'magazine' ),
) );
genesis_register_sidebar( array(
'id' => 'home-right',
'name' => __( 'Home Right', 'magazine' ),
'description' => __( 'This is the home right section.', 'magazine' ),
) );
genesis_register_sidebar( array(
'id' => 'home-bottom',
'name' => __( 'Home Bottom', 'magazine' ),
'description' => __( 'This is the home bottom section.', 'magazine' ),
) );
genesis_register_sidebar( array(
'id' => 'after-post-ad',
'name' => __( 'After Post Ad', 'magazine' ),
'description' => __( 'This is the after post ad section.', 'magazine' ),
) );
genesis_register_sidebar( array(
'id' => 'after-content-ad',
'name' => __( 'After Content Ad', 'magazine' ),
'description' => __( 'This is the after content ad section.', 'magazine' ),
) );</code>Thanks, Doug
http://prowsefarm.org/blog/April 18, 2013 at 8:13 pm #36271Dorian Speed
MemberWhich menu are you trying to reposition - the primary, or the secondary? The code you're using will move the primary menu above the header, which is what I see when I look at your site. To move the secondary menu, I believe you should use:
/** Reposition the secondary navigation menu */ remove_action( 'genesis_after_header', 'genesis_do_subnav' ); add_action( 'genesis_before_header', 'genesis_do_subnav' );
Bringing websites Up to Speed
Firebug will light the way to understanding the secrets of the Internet!April 19, 2013 at 8:25 am #36358Doug
MemberDorian, thank you; I will take a look and get right back to you.
Doug
April 19, 2013 at 8:34 am #36360Doug
MemberDorian,
It worked! Thank you, thank you, thank you; you are a good and helpful person. 🙂
Namasté,
Doug
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.