The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

remove menu from static front page (6 posts)

  1. eshoosmith
    Posted 2 years ago #

    Could someone help me remove the menu from the front static page of my site please?

  2. Axel13
    Posted 2 years ago #

    1. open header.php
    2. near the bottom find "nav role="navigation" class="site-navigation main-navigation"..."
    3. add a php if condition.

    I think this should work, but didn't try it:

    <?php if(!is_front_page() ) { ?>
    		<nav role="navigation" class="site-navigation main-navigation">
    			<h1 class="screen-reader-text"><?php _e( 'Menu', 'spun' ); ?></h1>
    			<div class="screen-reader-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'spun' ); ?>"><?php _e( 'Skip to content', 'spun' ); ?></a></div>
    			<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
    		</nav><!-- .site-navigation .main-navigation -->
    	<?php } ?>


  3. esmi
    Forum Moderator
    Posted 2 years ago #

    No! Do not edit the theme itself. First create a child theme for your changes.

    @Axel13: Please do not encourage people to edit themes downloaded from wordpress.org. They need to create child themes or they will lose all of their changes when they next upgrade.

  4. As that's an actively developed theme please don't do that to the header.php file. ;)

    Instead create an activate a child theme of Spun and make a copy of the wp-content/themes/spun/header.php into your wp-content/themes/spun-child/ directory. Then make those edits on that copy.

    That way you will not lose your work when the Spun theme get's updated.

    Edit: Beaten to it by 62 seconds! Drats!

  5. eshoosmith
    Posted 2 years ago #

    I do have a working child theme, but I am unable to get that code to work, any other ideas? specific instructions please, i'm very much a beginner.

  6. salsaturation
    Posted 2 years ago #

    you can hide it via css. Please provide a link to your site and I will show you how

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic