How to change the title text of the main page in the navigation menu?

I created a wordpress site. The home page is displayed in the navigation menu with the name "Home".

I want to change this text to another text so that in the navigation menu it does not appear as "Home", instead it should be displayed as some other text.

How can I change this text?

+4
source share
4 answers

So, to change the name of the Home button, go to:

WP-includes / post-template.php

Search for:

// Show Home in the menu if ( isset($args['show_home']) && ! empty($args['show_home']) ) { if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] ) $text = __('Home'); 

Do you see the last "home" text? There you go, change it to whatever you want.

+12
source

If we talk about the default Twenty Twelve theme:

  • Open ../ twentytwelve / functions.php
  • Find the tweetelve_page_menu_args function.
  • Replace

    $ args ['show_home'] = true;

with

 $args['show_home'] = "Your name"; 

Hoooray !!! :)

+6
source

It depends on each topic that you would like to use.

For Twenty Twelve you need to set the front page (static page) and give it a name.

then you copy the .php functions to the child themes folder, and then find this:

 /** * 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 change this single line:

  $args['show_home'] = false; 

Alternatively, a simple solution is to go to the "Menu" tab on the left and play with the menu options there, you can add your own if you want.

+1
source

Source: https://habr.com/ru/post/1390398/


All Articles