• Resolved princeps

    (@princepsbruno)


    Hi there,

    Thanks for your theme btw it’s awesome!

    We are trying to remove the menu on a specific page but been unsuccessful so far.

    Any suggestions?

    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi, princeps, I’m another user of the Neve theme.

    If you are comfortable enough with PHP, I would suggest inserting the following code into your child theme’s functions.php file or using a plugin such as Code Snippets to insert code snippets on your site:

    add_filter( "wp_nav_menu", "remove_menu_specific_page", 10, 2 );
    
    function remove_menu_specific_page( $nav_menu, $args )
    {
    	if ( is_page(11) )
    	{
    		return "";
    	}
    	
    	return $nav_menu;
    	
    }

    11 is an example of a value for the function; please replace that value with the appropriate page ID.

    Here is additional information about the is_page function:
    https://developer.wordpress.org/reference/functions/is_page/

    Hi @princepsbruno

    The theme doesn’t have the feature to hide the menu on a specific page. You can try the solution mentioned by @plantprogrammer.

    Thread Starter princeps

    (@princepsbruno)

    @plantprogrammer

    Thanks! It worked!!

    cheers

    Thread Starter princeps

    (@princepsbruno)

    Oh,

    But it still shows on mobile. Any solutions for that too?

    thanks

    Hi, princeps, please try to use the following CSS to remove the menu on mobile:

    @media (max-width: 960px)
    {
        body#neve_body.page-id-11 .builder-item.hfg-item-last.col-4.tablet-right.mobile-right 
        {
            display: none;
        }
    }
    Thread Starter princeps

    (@princepsbruno)

    @plantprogrammer

    Thanks again that did the trick! Though the hamburger menu still shows.

    I am not an expert but i tried

    @media (max-width: 960px)
    {
    body#neve_body.menu-mobile-toggle.item-button.navbar-toggle-wrapper
    {
    display: none;
    }
    }

    but it did not work lol

    any suggestions?

    Thanks

    Hi, princeps, .menu-mobile-toggle.item-button.navbar-toggle-wrapper is a child of the body so there needs to be a space:

    @media (max-width: 960px)
    {
      body#neve_body.page-id-11 .menu-mobile-toggle.item-button.navbar-toggle-wrapper
      {
      display: none;
      }
    }
    

    You also need to specify the page ID; otherwise, all pages will have the menu hidden.

    Thread Starter princeps

    (@princepsbruno)

    hey @plantprogrammer

    thanks for taking your time to help out!!

    i tried the code you suggested using the right page id but that hamburger menu is still there.

    what do you think it might be the problem? apart from me being a lousy coder lol

    cheers

    Hi, princeps, maybe another CSS rule is conflicting with the one I gave you (since I can’t see the page that you’re referencing, you could have other CSS rules being applied to the hamburger menu possibly).

    Please try adding ! important to the rule like this:

    @media (max-width: 960px)
    {
      body#neve_body.page-id-11 .menu-mobile-toggle.item-button.navbar-toggle-wrapper
      {
      display: none !important;
      }
    }
    Thread Starter princeps

    (@princepsbruno)

    @plantprogrammer

    Hey Thanks for that!!!

    cheers

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘remove menu on specific page’ is closed to new replies.