• Resolved davereed

    (@davereed)


    I really like this theme, but I would like to have parent menu items linked. Right now when I add a child menu item, the parent is no longer linked. Help?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author Silkalns

    (@silkalns)

    This theme uses wp-bootstrap-navwalker and it doesn’t have an option to make top menu item clickable. In case they decide to update this awesome Nav Walker, I will also implement it in theme. Otherwise there is no easy workaround for this.

    Rats. I should have googled and found this answer before trying.

    I found a solution for this:

    In /wp-content/themes/sparkling/inc/navwalker.php
    LINE: 84

    Replace this:

    // If item has_children add atts to a.
          if ( $args->has_children && $depth === 0 ) {
              $atts['href'] = '#';
              $atts['data-toggle'] = 'dropdown';
              $atts['class']  = 'dropdown-toggle';
          } else {
              $atts['href'] = ! empty( $item->url ) ? $item->url : '';
          }

    AND WRITE THIS:

    if ( $args->has_children && $depth === 0 ) {
              $atts['href'] = ! empty( $item->url ) ? $item->url : '';
          } else {
              $atts['href'] = ! empty( $item->url ) ? $item->url : '';
          }

    Hey tekilalemon,
    I figured i’d give you your props. Well done man! However, now the mobile menu doesn’t dropdown. I’ll have to try and figure out how to change that to a non-link once mobile

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Make parent menu item linked’ is closed to new replies.