Title: Make parent menu item clickable
Last modified: June 2, 2021

---

# Make parent menu item clickable

 *  [phoenixim](https://wordpress.org/support/users/phoenixim/)
 * (@phoenixim)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/make-parent-menu-item-clickable/)
 * I’ve added child links to a parent menu item and now the parent item is not linkable.
   Need the parent to still be clickable. Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmake-parent-menu-item-clickable%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Steven (LyraThemes)](https://wordpress.org/support/users/stevenlyrathemes/)
 * (@stevenlyrathemes)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/make-parent-menu-item-clickable/#post-14722437)
 * Hi [@phoenixim](https://wordpress.org/support/users/phoenixim/),
 * I apologize for the late reply- seems we didn’t receive a notification of your
   post for some reason.
 * There isn’t currently an option to change this behavior, but if you’re using 
   a child theme it’s possible with a bit of tweaking.
 * If you have an active child theme and are comfortable making a couple of careful
   edits to the code, let me know and I can write up the steps required.
 * Thanks for getting in touch, and I apologize again for the delay!
 *  Thread Starter [phoenixim](https://wordpress.org/support/users/phoenixim/)
 * (@phoenixim)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/make-parent-menu-item-clickable/#post-14724520)
 * Hello Steven,
 * I have a child theme and can edit it so any steps would help. Thanks!!!
 * Rob
 *  [Steven (LyraThemes)](https://wordpress.org/support/users/stevenlyrathemes/)
 * (@stevenlyrathemes)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/make-parent-menu-item-clickable/#post-14884256)
 * Hi Rob,
 * I am so sorry- we didn’t receive a notification again, even though we’re subscribed
   to the topic.
 * If you still need this functionality, here are the steps to achieve it:
 * 1. Copy (not move) /includes/wp_bootstrap_navwalker.php from your parent theme
   into the same location within your child theme.
 * 2. In the child copy of this file, replace this code around line 128:
 *     ```
       // If item has_children add atts to a.
       if ( $args->has_children && $depth === 0 ) {
       	$atts['href'] = '#';
       	$atts['data-toggle'] = 'dropdown';
       	$atts['class'] = 'dropdown-toggle';
       	$atts['aria-haspopup'] = 'true';
       	$atts['aria-expanded'] = 'false';
       } else {
       	$atts['href'] = ! empty( $item->url ) ? $item->url : '';
       }
       ```
   
 * With this code:
 *     ```
       //For clickable parent nodes
       if ( $args->has_children && $depth === 0 ) {
       	$atts['class'] = 'dropdown-toggle';
       	$atts['aria-haspopup'] = 'true';
       	$atts['aria-expanded'] = 'false';
       }
       $atts['href'] = ! empty( $item->url ) ? $item->url : '';
       ```
   
 * 3. In your child functions.php, add this line just after the opening PHP tag:
   `
   require get_theme_file_path('/includes/wp_bootstrap_navwalker.php');`
 * If you have any trouble, just let us know- I’ll try to manually keep an eye on
   this thread since we’re not receiving notifications.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Make parent menu item clickable’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/vega/3.0.0/screenshot.jpg)
 * Vega
 * [Support Threads](https://wordpress.org/support/theme/vega/)
 * [Active Topics](https://wordpress.org/support/theme/vega/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/vega/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/vega/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Steven (LyraThemes)](https://wordpress.org/support/users/stevenlyrathemes/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/make-parent-menu-item-clickable/#post-14884256)
 * Status: not resolved