Change nav text 'HOME' to smth else & dissallow to appear at homepage (4 posts)

  1. jdran
    Posted 3 years ago #

    I am using the TwentyTwelve and I was trying to find a way to change the text 'HOME' to my own language but I couldn't find anything in forums or what I found was obsolete (or at least the older theme)

    I found this into functions.php:

     * Makes our wp_nav_menu() fallback -- wp_page_menu() -- show a home link.
     * @since Twenty Twelve 1.0
    function twentytwelve_page_menu_args( $args ) {
    	if ( ! isset( $args['show_home'] ) )
    		$args['show_home'] = true;
    	return $args;
    add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' );

    and I changed this single line to:

    $args['show_home'] = false;

    but I am not sure (as I don't know php) if it is the right one. Is it a good approach, or could / should do it an other way?

    Also, how can I delimit the appearance of the Home nav link to all other pages except the actual home page?

  2. Pioneer Web Design
    Posted 3 years ago #

    1. Create your own menu and add to it what you want:


    2. A better approach may be to add CSS that 'highlights' the page (menu item) the user is on...


    #access .current-menu-item > a, #access .current-menu-ancestor > a, #access .current_page_item > a, #access .current_page_ancestor > a {
    	background-color: #C0C0C0;

    Use your color desired in above...

    See this CSS (in a Twentyeleven Child Theme) in action at my site:


    (and a custom menu)

  3. wpbum
    Posted 3 years ago #

    Are you making your menu under appearance - menu? Everything you are looking to do is fairly simple there.

  4. jdran
    Posted 3 years ago #

    I totally ignored that part. So it seems, I really went for the hard way. Thanks guys.

    About the second,
    Seacoast Web Design, I don't get what you mean.. maybe I wasn't clear..

    What I want is to let the "Home" navigation link (menu) appear on all pages except the home page.

Topic Closed

This topic has been closed to new replies.

About this Topic