Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bradley-D/ec3928434931396882df to your computer and use it in GitHub Desktop.
Save Bradley-D/ec3928434931396882df to your computer and use it in GitHub Desktop.
// Line 87 of
// If item has_children add atts to a.
if ( $args->has_children && $depth === 0 ) {
$atts['href'] = ! empty( $item->url ) ? $item->url : '';
$atts['class'] = 'dropdown-toggle';
//$atts['data-toggle'] = 'dropdown'; <- This line gets added in theme.js when window width is < 768
$atts['aria-haspopup'] = 'true';
} else {
$atts['href'] = ! empty( $item->url ) ? $item->url : '';
}
@media (min-width: 768px) {
.dropdown:hover .dropdown-menu {
display: block;
}
}
jQuery(function($) {
// Bootstrap menu magic
$(window).resize(function() {
if ($(window).width() < 768) {
$(".dropdown-toggle").attr('data-toggle', 'dropdown');
} else {
$(".dropdown-toggle").removeAttr('data-toggle dropdown');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment