New answers tagged

1

Well, you wouldn't need a walker for that, if it's simply adding a data attribute or something like that you could just use the items_wrap parameter. View wp_nav_menu() in Resources: $items_wrap = '<div class="top-nav" mine="something">'; $items_wrap .= '<ul id="%1$s" mine="something2" class="nav %2$s">%3$s</ul>'; $items_wrap .= ...


3

We could rewrite: wp_list_comments( array( 'callback' => 'bootstrap_comment_callback', )); with the null walker parameter: wp_list_comments( array( 'walker' => null, 'callback' => 'bootstrap_comment_callback', )); which means we are using the default Walker_Comment class: wp_list_comments( array( 'walker' ...


2

Not sure, but maybe something like this will work? Add to the functions.php. See explanation here. //This function is responsible for adding "my-parent-item" class to parent menu item's function add_menu_parent_class( $items ) { $parents = array(); foreach ( $items as $item ) { //Check if the item is a parent item if ( $item->menu_item_parent ...


0

You can use the wp_nav_menu() arguments like so: wp_nav_menu( array( 'menu' => 'Whatever Your Menu Name Is', 'link_before' => '<span class="main-nav__item-icon-wrapper"><i class="main-nav__item-icon icon-home"></i></span><span class="main-nav__item-content">', 'link_after' => '</span>' ) ...



Top 50 recent answers are included