Genesis: Add nav into custom header function

I am trying to make a custom header function in a Genesis child theme that includes site title, description, nav, and one additional div. The nav does not show up with this code:

remove_action( 'genesis_after_header', 'genesis_do_nav' );
remove_action( 'genesis_header', 'genesis_do_header' );
add_action( 'genesis_header', 'genesis_do_new_header' );
function genesis_do_new_header() {
    echo '<div id="title-area">';
    do_action( 'genesis_site_title' );
    do_action( 'genesis_site_description' );
    echo '</div>';
    do_action( 'genesis_do_nav' );
    echo '<div id="additional"></div>';
}

I then tried adding

Read More
add_action( 'genesis_header', 'genesis_do_nav' );

after removing the after_header do_nav action with a variety of different priorities, but could not get it to go in between the site description and the #additional div. Thoughts?

Related posts

1 comment

  1. As a workaround, I separated out the custom header functions and removed/added the nav in between them:

    remove_action( 'genesis_header', 'genesis_do_header' );
    add_action( 'genesis_header', 'genesis_do_new_header_1', 5 );
    function genesis_do_new_header_1() {
        echo '<div id="title-area">';
        do_action( 'genesis_site_title' );
        do_action( 'genesis_site_description' );
        echo '</div>';
    }
    remove_action( 'genesis_after_header', 'genesis_do_nav' );
    add_action( 'genesis_header', 'genesis_do_nav', 6 );
    add_action( 'genesis_header', 'genesis_do_new_header_2', 7 );
    function genesis_do_new_header_2() {
        echo '<div id="additional"></div>';
    }
    

    This works just fine for now– but if there is a cleaner solution out there would be happy to hear it!

Comments are closed.