Exclude Page From WordPress Navigation Menu

I have a navigation menu that consist of three links (pages). They are ‘Home’, ‘About Me’ and ‘Thanks You’. I prefer to hide ‘Thanks You’ link on the navigation menu because the content only should be appear when user send me donations. Here is the navigation menu (I use Sorbet theme from WordPress).nav_menuTo hide ‘Thanks You’ link, I need to edit header.php file in /wp-content/themes/sorbet-wpcom/ directory.  Then find the line with wp_nav_menu command like this line :

<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>

Before putting the mess to the code, I need to find out the Page ID of the ‘Thanks You’ page. I can’t find the ID in the Post List of the admin page so I just put ‘echo’ PHP command like this before the above code :

<?php echo $post->ID; ?>

I got the Page ID (Its 536) then I made a change to ‘wp_nav_menu’ code to exclude the Page ID from the navigation menu like this:

<?php wp_nav_menu( array( 'theme_location' => 'primary', 'exclude'=>536 ) ); ?>

Now the ‘Thanks You’ link has gone.nav_menu_final

Loading