WordPress.org

Ready to get started?Download WordPress

Forums

Spun
remove menu from static front page (6 posts)

  1. eshoosmith
    Member
    Posted 4 months ago #

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

  2. Axel13
    Member
    Posted 4 months 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 } ?>

    GL!

  3. esmi
    Forum Moderator
    Posted 4 months 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
    Member
    Posted 4 months 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
    Member
    Posted 4 months ago #

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

Reply

You must log in to post.

About this Theme

About this Topic