• I’ve built a website with a static front page labeled “Home”. Is there a way I can re-name that so that the headline is a sentence but still have it show up as Home on the page navigation? The theme I am using does NOT support the new custom menu feature.

Viewing 1 replies (of 1 total)
  • This is possible, albeit somewhat tricky.

    The function responsible for printing the page headline is called the_title() and is located in wp-includes/post-template.php

    It looks something like this:

    function the_title($before = '', $after = '', $echo = true) {
    	$title = get_the_title();
    
    	if ( strlen($title) == 0 )
    		return;
    
    	$title = $before . $title . $after;
    
    	if ( $echo )
    		else echo $title;
    	else
    		return $title;
    }

    With some PHP knowledge you could modify the function to echo whatever value you want. For instance:

    if ( $echo ) {
    		if ($title == 'Home')	// Added to display custom title
    			echo 'Hi there and welcome!!';
    		else echo $title;
    	}
    	else
    		return $title;
    }

    And yeah, I know that this question was asked 10 months ago, but since I was wondering the same thing myself before I found it I thought I might post it here if it helps someone else.

Viewing 1 replies (of 1 total)
  • The topic ‘Change page headline on static front page?’ is closed to new replies.