Sep 6, 2018 · 1 min read
This is great, thank you.
Here’s the fix I used for mobile, utilizing WordPress’s wp_is_mobile function.
if ( wp_is_mobile() ) {
// Parent link inactive
$atts[‘href’] = ‘#’;
// Parent link toggles dropdown
$atts[‘data-toggle’] = ‘dropdown’;
} else {
// Parent link active
$atts[‘href’] = ! empty( $item->url ) ? $item->url : ‘’;
// Parent link shows dropdown on hover
$atts[‘data-hover’] = ‘dropdown’;
};Hope this helps someone else!