Lego2012
12/13/2016 - 5:00 PM

Wrap Primary and Secondary Navigation in custom divs

Wrap Primary and Secondary Navigation in custom divs

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

//* Wrap .nav-primary in a custom div
add_filter( 'genesis_do_nav', 'genesis_child_nav', 10, 3 );
function genesis_child_nav($nav_output, $nav, $args) {

    return '<div class="nav-primary-wrapper">' . $nav_output . '</div>';

}

//* Wrap .nav-secondary in a custom div
add_filter( 'genesis_do_subnav', 'genesis_child_subnav', 10, 3 );
function genesis_child_subnav($subnav_output, $subnav, $args) {

    return '<div class="nav-secondary-wrapper">' . $subnav_output . '</div>';

}