How To Make Menu Stay As Hamburger Menu?

Hi, I have a little experience editing CSS, but can’t figure this out. I’d like the nav menu to always be the hamburger menu. It looks cleaner when using the slider header to have less text up there. Can you let me know what to edit in the style editor to achieve this? Thank you.

Dear Harkz,

Thank you for asking.

In order to achieve that objective, could you please try to do the following?

  1. Open the js/main.js in your code editor, then copy the whole content of it; then paste it into js/main.min.js. So it will be more readable

  2. In the js/main.min.js, find the following code block:

if ( matchMedia( 'only screen and (max-width: 1024px)' ).matches ) {
	currMenuType = 'mobile';
}

Here is the viewport breakpoint was specified.

  1. Change it to the following:
if ( matchMedia( 'only screen and (max-width: 9999px)' ).matches ) {
  currMenuType = 'mobile';
}
  1. Apply the following CSS code through the Simple Custom CSS plugin or child theme’s style.css.
@media only screen and (max-width:9999px){
  
  #mainnav{
    display: none;
  }
  
  
  .btn-menu{
    display: block;
  }  
  
}

Once you are done, you would need to clear you web browser’s cache before reloading your site.

As you are editing the theme’s core file, you should take it at your own risk. The changes you have made there will be lost once the theme gets updated in the future. So you should do this adjustment again.

Regards,
Kharis

I followed these instructions and it did not work. After trying to make changes to my main.min.js file I messed it up. How can I get back the main.min.js in its original format? I believe min files are viewed more favorably by Google. Thank you. I wish I could figure out the script above, but at this point, I just want my main.min.js file back the way it was.

Hello there,

You can get the original code on the WordPress.org’s SVN repository on this link.

Regards,
Kharis

Hello,
joshlipsonfg-com said in the lastpost that the solution was not working.
I also tried it with your instructions, but it also didn’t work. After the hack my site stuck with white screen.

Is there a working solution?

Thnx a lot,

Ingo

Hello there,

Try this solution please.

Regards,
Kharis

Hi Kharis,

thnx a lot. That worked for me.

Regards,
Ingo