WordPress.org

Ready to get started?Download WordPress

Forums

Home Menu Hide? (9 posts)

  1. Alex Hodge
    Member
    Posted 9 months ago #

    I would like to hide the menu on the home page as i want them to click the enter button and pick where they are first and do not what them bypassing the map.

    Is there any way i can hide the menu off the blain theme on my home page.

    Please help

  2. morollian
    Member
    Posted 9 months ago #

    I guess the ideal solution would be to use the conditional tag is_home() in the template file header.php (or the template file your theme is using to display the header) to tell wordpress to display the menu in every page but home.

    If you are not into theme developing, I would recomend doing it with jQuery+CSS. Just paste the following code at the end of your funcitons.php flie, is not the perfect solution, but it will work (assuming that your menu has the class .menu, otherwise I would need to see your code, or at least a link to your website, to change it by the proper CSS class):

    function hide_menu() {
    
     if (is_home()):
        echo "<script type='text/javascript'>$('.menu').css('display','none');</script>";
     endif;
    
    }
    
    add_action('wp_footer','hide_menu');

    Hope it helps!

  3. Alex Hodge
    Member
    Posted 9 months ago #

    could you tell me what to do i have put the code you said at the end of functions.php but it didn't change anything.

  4. WPyogi
    Volunteer Moderator
    Posted 9 months ago #

    Do not modify theme files - as your changes will be lost when the theme is updated. You should use a child theme if you want to modify theme files - http://codex.wordpress.org/Child_Themes

    An easier way to do this is to add this CSS - to custom CSS if the theme has it or add via a custom CSS plugin:

    .home .nav-wrapper {
       display: none;
    }

    You should also be asking this on the theme's own forum:

    http://wordpress.org/support/theme/blain

  5. morollian
    Member
    Posted 9 months ago #

    Try changing thes line:

    echo "<script type='text/javascript'>$('.menu').css('display','none');</script>";

    for this one:

    echo "<script type='text/javascript'>$('.nav-wrapper').css('display','none');</script>";

  6. WPyogi
    Volunteer Moderator
    Posted 9 months ago #

    @morollian - please do not advise people to modify theme files.

  7. morollian
    Member
    Posted 9 months ago #

    Of course Is better to do a child theme (actually is the only thing that people should do), but I didn't know that Allex wasnt using a custom theme... Anyway your aproach is much easier..

    I would keep that in mind WPyogi ;)

  8. Alex Hodge
    Member
    Posted 9 months ago #

    Thanks WPyogi Worked the treat!! thank you so much!

  9. Alex Hodge
    Member
    Posted 9 months ago #

    Okay another quick problem is that I'm using wordpress multisite feature and its hiding both home pages for the normal and the multisite.
    is there a way to only hide it for the normal site?

Reply

You must log in to post.

About this Topic

Tags