Support » Theme: Ryu » How to remove "Home" from nav bar***only when @Home

  • Resolved cbilgen

    (@cbilgen)


    To any who may help,
    How can I remove “Home” link/button from my navigation bar only for when I’m on the home page? (I want it there for other pages, but to have an extra button for “Home” when already on the Home page is unnecessary and adds clutter…)
    My site is http://baykusmedia.com/

    Thanks alot!
    C.

Viewing 15 replies - 1 through 15 (of 18 total)
  • esmi

    (@esmi)

    Forum Moderator

    Try adding:

    function my_show_home( $args ) {
    	$args['show_home'] = false;
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'my_show_home' );

    to your child theme’s functions.php file.

    Hmm, I must be doing something wrong because it is not changing anything…Does that code just go anywhere in the functions.php file?

    esmi

    (@esmi)

    Forum Moderator

    Yes. Anywhere after the opening <?php tag of your child theme’s functions.php file. Please note that I made a minor error in the original code that I’ve now corrected. Try again with a new copy.

    I am still unfortunately not seeing any change. Also, I just noticed I had moved(instead of copied) the functions.php from my parent to the child theme. and when I try to replace it/re-copy it back, my site goes blank…could this have something to do with why it is not working?

    The child theme functions file cannot be a copy of the parent one – it will crash the site. The child theme one should only contain the above code esmi posted. Also see:

    http://codex.wordpress.org/Child_Themes#Using_functions.php

    Ahh ok that is good to know. Now though, I put the code in the child theme’s functions.php and the code itself shows up at the top of my website…

    Ok fixed that, but my Home button is still there…
    here is my functions.php in my child theme:

    <?php
    function my_show_home( $args ) {
    	$args['show_home'] = false;
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'my_show_home' );
    ?>

    Is something wrong?

    paulwpxp

    (@paulwp)

    Font hero

    That Home menu item has this class menu-item-42, so it’s what you put there. To not display this only on front home page, use body class to target it and display none.

    .home.page .menu-item-42 { display:none; }

    Forgive my incompetence with code, but where does .home.page .menu-item-42 { display:none; } go?

    esmi

    (@esmi)

    Forum Moderator

    Add it to the bottom of your child theme’s stylesheet.

    Wow so simple! Worked great, thanks alot for the help everyone.

    Also, would you happen to know how I can hide the “Home” page title that shows up at the bottom of the home page as well?

    esmi

    (@esmi)

    Forum Moderator

    Try:

    body.home.page .entry-header {
    display: none;
    }

    Awesome- thanks esmi!

    esmi

    (@esmi)

    Forum Moderator

    No probs. 🙂

    Also, is there a way to remove the footer? I removed the text content of the footer but I’d like to get rid of the divider/extra space as well. I tried deleting the footer content completely but it messed up my search bar at the top of my site.
    Any suggestions?

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘How to remove "Home" from nav bar***only when @Home’ is closed to new replies.