positioning new sidebar below header/before nav

Community Forums Forums Design Tips and Tricks positioning new sidebar below header/before nav

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  MissKitty 1 year, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20427

    MissKitty
    Participant
    Post count: 17

    Using genesis-sample.

    I registered a new sidebar, which I want it to display BELOW the #header, above the #nav, like so:

    #header
    #new-sidebar
    #nav and #subnav
    #content-sidebar-wrap

    However, the new sidebar renders below #nav as opposed to above #nav.

    This is the code added to sample-child functions.php file to register the new sidebar, and position new sidebar:

    // Register new widget area
    genesis_register_sidebar( array(
    ‘id’ => ‘after-header-info’,
    ‘name’ => __( ‘After Header Info’, ‘genesis-sample’ ), ‘description’
    => __( ‘This is a widget area that can be placed after the header,
    full width, for information’, ‘genesis-sample’ ),) );

    //now tell theme where to display it – can also add using simple hooks instead of this

    add_action( ‘genesis_after_header’,
    ‘child_after_header_info_sidebar’ ); function
    child_after_header_info_sidebar() { echo ”; dynamic_sidebar(
    ‘after-header-info’ ); echo ”; }
    I also I tried moving my nav menu to just above the content-sidebar-wrap, but that placed the nav menu INSIDE OF the #inner div / genesis-before-content-sidebar:

    //move primary nav
    remove_action( ‘genesis_after_header’, ‘genesis_do_nav’ );
    add_action( ‘genesis_before_content_sidebar_wrap’,
    ‘genesis_do_nav’);

    // Move secondary nav menu
    remove_action( ‘genesis_after_header’, ‘genesis_do_subnav’ );
    add_action( ‘genesis_before_content_sidebar_wrap’,
    ‘genesis_do_subnav’);
    So, two questions:
    1. How to display my new sidebar directly below #header, and above #nav

    2. When I use hook reference  genesis_before_content_sidebar_wrap,
    code is rendered INSIDE content-sidebar-wrap, as opposed to immediately before the content-sidebar-wrap div.
    Thanks in advance.

    #20908

    Brian Bourn
    Participant
    Post count: 98

    Just add a priority on the first line like below so your new widget area will “fire” before the nav or subnav.

    [php]add_action( ‘genesis_after_header’, ‘child_after_header_info_sidebar’, 1 );[/php]


    Bourn Creative | bourncreative.com | Twitter

    #21479

    MissKitty
    Participant
    Post count: 17

    Holy wow, that worked! You are a genius :)

    Thank you Brian!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.