WordPress.org

Forums

Remove Home From Header Navigation (17 posts)

  1. seandavidson
    Member
    Posted 4 years ago #

    I for the love of me can not figure out how to remove the Home Link from my Twenty Ten Child Theme.

    I have changed this line:

    $args['show_home'] = true;
    to
    $args['show_home'] = false;

    It still does not seem to want to remove the Home link. Any thoughts or help.

    http://ocpoundhounds.com

    Sean

  2. Tara
    Volunteer Moderator
    Posted 4 years ago #

    -try clearing cache in your browser before viewing the updated page. To clear cache in your browser, press clrl+f5 keys simultaneously. Also, try different computer/different browser.

    -also, have tried removing it via:

    Dashboard => Appearnace - Menus

  3. seandavidson
    Member
    Posted 4 years ago #

    Yes cleared cache on browser Home under the nav bar is still there. I did not want to build a custom menu. It is easier to use it as it is for the person updating the site. Just want to be able to remove Home from the Navigation Bar.

  4. Tara
    Volunteer Moderator
    Posted 4 years ago #

    you may try to search in your theme's template ( for example, header.php, etc.) to find the code, and strike it out.

  5. SpankMarvin
    Member
    Posted 4 years ago #

    What function is your theme using to render the navigation?

  6. seandavidson
    Member
    Posted 4 years ago #

    I am using the Tweny Ten Theme, I have not made any changes except make a Child Theme based on it. From the info I got from my Google search was to change this

    $args['show_home'] = true;
    to
    $args['show_home'] = false;

  7. esmi
    Forum Moderator
    Posted 4 years ago #

    Try adding:

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

    to your child theme's functions.php file.

  8. seandavidson
    Member
    Posted 4 years ago #

    @esmi Thanks I tried that and still no go. Here is what is in my functions.php for my child theme.

    <?php
    function my_page_menu_args( $args ) {
    	$args['show_home'] = false;
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'my_page_menu_args' );
    
    ?>
  9. esmi
    Forum Moderator
    Posted 4 years ago #

    Site url?

  10. seandavidson
    Member
    Posted 4 years ago #

    Site was listed in the first post.

    http://ocpoundhounds.com

  11. wordman1994
    Member
    Posted 4 years ago #

    seandavidson,

    I don't know if you ever got this figured out, but I just did.

    Deactivate with a remark or remove this line from header.php:

    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>

    Just worked for me perfectly.

    Cheers,

    wordman

  12. lukeratto
    Member
    Posted 3 years ago #

    @wordman1994
    that dumped the whole nav bar in twentyeleven theme.

    duke

  13. wordman1994
    Member
    Posted 3 years ago #

    lukeratto,

    Crap. I have to admit, I only ever use and modify twentyten theme because I don't ever do any drastic theme mods to my blogs. Hopefully someone here can help with twentyeleven.

    Cheers,

    wordman

  14. lukeratto
    Member
    Posted 3 years ago #

    no worries, what's weird is in my function.php file I've got it displaying

    function twentyeleven_page_menu_args( $args ) {
    $args['show_home'] = false;
    return $args;

  15. wordman1994
    Member
    Posted 3 years ago #

    lukeratto,

    I can relate. I spent a lot of time sifting through theme mods, and it seems as though they make significant changes from one to the next. Another reason I just stick to modifying the same theme. Once you nail this for twentyeleven, stick with it from here on out unless you have enough time to hunt for the answers.

    Best of luck!

    Sincerely,

    wordman

  16. SpankMarvin
    Member
    Posted 3 years ago #

    No reason why this would necessarily work over setting to false, but any chance that making it unset($args['show_home']); might work?

  17. lukeratto
    Member
    Posted 3 years ago #

    @SpankMarvin-

    Nope, but thanks

    this shouldn't be that hard, I feel like I've got a decent feel for WP, but I am no PHP wiz

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.