WordPress.org

Ready to get started?Download WordPress

Forums

[Theme: Colorway] Removing Horizontal Menu from Front Page Only (5 posts)

  1. Paine2011
    Member
    Posted 1 year ago #

    Hello Everyone,

    I'm trying to remove the wordpress Horizontal menu from the homepage only, I want it to be visible on the other pages.

    However, my code doesn't seem to work.
    The header looks like this:

    <!--Start MenuBar-->
                    <div class="menu-bar">
                        <div id="MainNav">
                            <a href="#" class="mobile_nav closed"><?php _e('Pages Navigation Menu','colorway'); ?><span></span></a>
                            <?php inkthemes_nav(); ?>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <!--End MenuBar-->
                </div>
                <div class="clear"></div>
                <!--End Header Grid-->

    I know I have to do something with
    <?phpif ( is_home() ) { // This is a homepage} else { // This is not a homepage}?>

    but I can't get it to work.

    This is the site: http://nuhp.ruhosting.nl/soeb/

    Any help is appreciated.

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Do you have a Child Theme?

  3. Paine2011
    Member
    Posted 1 year ago #

    No, I checked it out and I don't think I use a child theme.
    I'm hoping to get this to work. If it's possible, then it would be a good idea to create a child theme. The site is empty so it's not a problem if something goes wrong.

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Make a child theme then copy your header.php file into your Child Theme directory.

    In your Child Theme header.php file, try using this;

    <!--Start MenuBar-->
    <?php
    if ( !is_home() ) {
    ?>
       <div class="menu-bar">
                        <div id="MainNav">
                            <a href="#" class="mobile_nav closed"><?php _e('Pages Navigation Menu','colorway'); ?><span></span></a>
                            <?php inkthemes_nav(); ?>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <!--End MenuBar-->
    <?php
    }
    ?>
                </div>
                <div class="clear"></div>
                <!--End Header Grid-->
  5. Paine2011
    Member
    Posted 1 year ago #

    Thank you very much.
    I'll try and experiment with these child themes.

Topic Closed

This topic has been closed to new replies.

About this Topic