Skip to content

Instantly share code, notes, and snippets.

@TheoKoenig
Forked from fieldoffice/sub-menu-wrap
Last active July 31, 2020 13:56
Show Gist options
  • Save TheoKoenig/0c6b508122ae95c82d4f81bc41309040 to your computer and use it in GitHub Desktop.
Save TheoKoenig/0c6b508122ae95c82d4f81bc41309040 to your computer and use it in GitHub Desktop.

Revisions

  1. TheoKoenig revised this gist Jul 31, 2020. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions sub-menu-wrap
    Original file line number Diff line number Diff line change
    @@ -2,14 +2,14 @@
    ******************************************/

    class submenu_wrap extends Walker_Nav_Menu {
    function start_lvl( &$output, $depth = 0, $args = array() ) {
    $indent = str_repeat("\t", $depth);
    $output .= "\n$indent<div class='sub-menu-wrap'><ul class='sub-menu'>\n";
    }
    function end_lvl( &$output, $depth = 0, $args = array() ) {
    $indent = str_repeat("\t", $depth);
    $output .= "$indent</ul></div>\n";
    }
    function start_lvl( &$output, $depth = 0, $args = array() ) {
    $indent = str_repeat("\t", $depth);
    $output .= "\n$indent<div class='sub-menu-section'><div class='sub-menu-row'><ul class='sub-menu'>\n";
    }
    function end_lvl( &$output, $depth = 0, $args = array() ) {
    $indent = str_repeat("\t", $depth);
    $output .= "$indent</ul></div></div>\n";
    }
    }

    <?php wp_nav_menu(array(
  2. @fieldoffice fieldoffice revised this gist May 25, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions sub-menu-wrap
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    /* EXTEND SUBNAV
    ******************************************/

    class submen_wrap extends Walker_Nav_Menu {
    class submenu_wrap extends Walker_Nav_Menu {
    function start_lvl( &$output, $depth = 0, $args = array() ) {
    $indent = str_repeat("\t", $depth);
    $output .= "\n$indent<div class='sub-menu-wrap'><ul class='sub-menu'>\n";
    @@ -13,5 +13,5 @@ class submen_wrap extends Walker_Nav_Menu {
    }

    <?php wp_nav_menu(array(
    'walker' => new submen_wrap()
    'walker' => new submenu_wrap()
    )); ?>
  3. @fieldoffice fieldoffice revised this gist May 25, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions sub-menu-wrap
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    /* EXTEND SUBNAV
    ******************************************/

    class submenu-wrap extends Walker_Nav_Menu {
    class submen_wrap extends Walker_Nav_Menu {
    function start_lvl( &$output, $depth = 0, $args = array() ) {
    $indent = str_repeat("\t", $depth);
    $output .= "\n$indent<div class='sub-menu-wrap'><ul class='sub-menu'>\n";
    @@ -13,5 +13,5 @@ class submenu-wrap extends Walker_Nav_Menu {
    }

    <?php wp_nav_menu(array(
    'walker' => new submenu-wrap()
    'walker' => new submen_wrap()
    )); ?>
  4. @fieldoffice fieldoffice created this gist Feb 22, 2015.
    17 changes: 17 additions & 0 deletions sub-menu-wrap
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    /* EXTEND SUBNAV
    ******************************************/

    class submenu-wrap extends Walker_Nav_Menu {
    function start_lvl( &$output, $depth = 0, $args = array() ) {
    $indent = str_repeat("\t", $depth);
    $output .= "\n$indent<div class='sub-menu-wrap'><ul class='sub-menu'>\n";
    }
    function end_lvl( &$output, $depth = 0, $args = array() ) {
    $indent = str_repeat("\t", $depth);
    $output .= "$indent</ul></div>\n";
    }
    }

    <?php wp_nav_menu(array(
    'walker' => new submenu-wrap()
    )); ?>