How can I reveal hidden submenus on the page load in the Twenty Fifteen theme? I would like it so that all the submenus are open on every page. Can someone please guide me on how this can be achieved? Thanks
Figured it out! Use the following PHP code.
/*
* Toggles the menu dropdowns to open state
*/
function mod_toggle_menus() {
?>
<script type='text/javascript'>
jQuery(document).ready( function() {
/* add toggled-on class to submenus */
jQuery('.sub-menu').addClass('toggled-on');
});
</script>
<?php
}
add_action('wp_footer' , 'mod_toggle_menus');