Archived topic
Function to remove "menu-toggle" inside generate_inside_navigation
3 replies · Started by Philipp on March 28, 2021
Hey there,
is it possible to remove the "menu-toggle" button that is inside the generate_inside_navigation() function with PHP, I don't look for just hiding it with CSS.
Thank you :)
Hi there,
You'll have to create a new template for your child theme if you want it removed completely as it is baked within the theme's file w/o any filters.
You can see it here:
https://github.com/tomusborne/generatepress/blob/7b35168f546f83a7abb098a8da3bc0674d49ddeb/inc/structure/navigation.php#L39
Mh that's a bummer. Another route I could go would be to remove the whole
#site-navigation div from the #masthead but that does unfortunately nothing:
add_action( 'after_setup_theme','tu_remove_sitenav' );
function tu_remove_sitenav() {
remove_action( 'generate_after_header_content', 'generate_add_navigation_float_right', 7 );
}
Any hints?
Hi there,
can you explain what it is your trying to achieve ? Are you just wanting the desktop menu displayed on all devices?
As per your function it should work as long as you have the navigation set to Float Right.