• Hello there,

    I have a basic question. I just want to change the default name of “home” page and into “blog” or something.

    I found few solutions for it as below;
    in your child theme’s functions.php, add some code;

    Solution 1

    add_action( 'after_setup_theme', 'twentyeleven_child_theme_setup' );
    function twentyeleven_child_theme_setup() {
    add_filter( 'wp_page_menu_args', 'twentyelevenchild_page_menu_args' );
    }
    function twentyelevenchild_page_menu_args( $args ) {
    	$args['show_home'] = 'Welcome!'; // rename 'home' button
    	return $args;

    }

    Solution 2
    If we are talking about the default theme “Twenty Twelve”:

    Open ../twentytwelve/functions.php
    Find twentytwelve_page_menu_args function.

    Replace

    $args['show_home'] = true;

    with

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

    But, I want to make this change without touching the core files. I just want to use child-theme option to do it. So how can I edit functions.php using child-theme option since it is impossible to copy it into child-theme folder?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The last post here explains it:

    http://wordpress.org/support/topic/how-do-i-remove-the-word-home-from-my-page-and-menu-using-twenty-twelve-theme?replies=4

    Also, please don’t bump here – these are volunteer forums and it’s only been a couple of hours…

    Thread Starter marmara34

    (@marmara34)

    @wpyogi

    I know it, thanks for warning anyway

    Thread Starter marmara34

    (@marmara34)

    Finally It worked out. For those who has the same question, here is how to do it;

    -First copy original functions.php file into your child-theme folder (via ftp)
    -Delete all the content of the newly copied functions.php
    -Enter this code inside the empty functions.php

    <?php
    /** Tell WordPress to run post_theme_setup()
     * when the 'after_setup_theme' hook is run.
     */
    
     add_action( 'after_setup_theme', 'post_theme_setup');
    
     if ( !function_exists('post_theme_setup' )):
     function post_theme_setup() {
    
     }
     endif;

    AND

    add_action( 'after_setup_theme', 'twentyeleven_child_theme_setup' );
    function twentyeleven_child_theme_setup() {
    add_filter( 'wp_page_menu_args', 'twentyelevenchild_page_menu_args' );
    }
    function twentyelevenchild_page_menu_args( $args ) {
    	$args['show_home'] = <strong>'Welcome!'</strong>; // rename 'home' button
    	return $args;
    }

    – Type the name that you want to use where it says ‘Welcome!’ for your (old) home page.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Child-theme functions.php and changing home-button’ is closed to new replies.