WordPress.org

Ready to get started?Download WordPress

Forums

Ho to change "Home" for its title (18 posts)

  1. andreand
    Member
    Posted 2 years ago #

    Hi there,

    I'm developing a website, I mean, without posts, just pages.

    My concern is about the homepage: it is displayed as "Home" instead of "Title Section 1".

    I mean, the current menu is something like this:
    <b>Home</b> - Title Section 2 - Title Section 3 - etc.

    instead of:
    <b>Title Section 1</b> - Title Section 2 - Title Section 3 - etc.

    How can I fixed it?

    Thanks a lot!

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    depends on your theme.

    some themes have this link 'hard-coded' into the menu (in header.php?); others are build on 'wp_page_menu()' where it is one of the parameters to show 'home' ( http://codex.wordpress.org/Function_Reference/wp_page_menu ); others use 'wp_nav_menu()' where you can build a custom menu ....

  3. andreand
    Member
    Posted 2 years ago #

    Thanks alchymyth!

    Following your instructions, I've just found on:
    wp-includes/post-template.php

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

    Does it mean that I should change:
    $text = __('Home');

    for the parameter of the section title?

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    no - do not edit wp core files (/wp-includes is a core folder)

    - what you are looking for should be in your theme's folder.

    for the top menu, the code is most likely to be found in header.php.

    should you reveal what theme you are using (and if this theme is freely accessible) someone might be able to point you to the right code.

  5. andreand
    Member
    Posted 2 years ago #

    Ops! Thanks alchymythh!

    Yes, navigation is on header.php:
    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>

    I'm using a mix of themes, based on Twentyten.

    Thanks a lot!

  6. andreand
    Member
    Posted 2 years ago #

    Some help, please?

    Thanks a lot!

  7. Jatin Hariani
    Member
    Posted 2 years ago #

    Could u mention the code that comes before the wp_nav_menu. I am almost certain that the "home" link is hard-coded and will have to be edited out of the theme.

  8. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    @andreand

    in twenty ten,
    edit functions.php and locate:

    function twentyten_page_menu_args( $args ) {
    	$args['show_home'] = true;
    	return $args;
    }

    change true to 'Title Section 1' (including the single quotes)
    http://codex.wordpress.org/Function_Reference/wp_page_menu

  9. andreand
    Member
    Posted 2 years ago #

    Thanks a lot jtnh231!

    What file are you asking me for?

    header.php:

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

    It's ok? Or are you asking for another file?

    Thanks!!

  10. andreand
    Member
    Posted 2 years ago #

    Thanks a lot alchymyth!

    It works ok. But not in a multi-language site. Sorry for not telling that before! I always forget this! My proyects are always multi-language ...

    So, the solution will be a little hard code ... sniff!

    Some help?

    Thanks a lot!

  11. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    this might work (totally untested, and dependant on how your multi-language site is done)

    $args['show_home'] = __( 'Title Section 1', 'twentyten' );

  12. andreand
    Member
    Posted 2 years ago #

    Thanks alchymyth for your help.

    But, the tanslation is not being done ...

    I mean, the 'Title Section 1' is the English title, but for French, Spanish, etc. it should be the right translation.

    I can figure out that the 'Title Section 1' should be a variable/function instead of a word.

    Some help?

    Thanks!!

  13. andreand
    Member
    Posted 2 years ago #

    For the translation I installed:

    qTranslate plugin
    http://wordpress.org/extend/plugins/qtranslate/

  14. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

  15. andreand
    Member
    Posted 2 years ago #

    Thanks a lot alchymyth!

    But, it's not a good solution, because the translation has to be on the functions.php file, and this means that the person who is in charge of the upgrade of the website should know php.

    So, backoffice will not have any sense at all ...

    I'll search more about it. If I found some solution, I'll post it here!

    If someone could help me, will be welcome!

    Thanks a lot!

  16. andreand
    Member
    Posted 2 years ago #

    I'm searching for help, please. I've been searching on internet and other forums, but I can't get it. Hours of reading and searching, but nothing useful ...

    I'm sure someone solved it.

    The problem is: in menu navigation link "home" appears instead of "title section 1".

    I installed:
    Twentyten theme + qTranslate plugin

    I mean, my website is multilanguage.

    Someone?

    Thanks a lot!!

  17. chuangzaoxingfu
    Member
    Posted 2 years ago #

    On the front page of the Home page or how to modify Home this word?

  18. EricLord
    Member
    Posted 2 years ago #

    You can also quite simply comment out the statement
    // $args['show_home'] = true;

Topic Closed

This topic has been closed to new replies.

About this Topic