phpwordpressnavigation

Wordpress "Home" link


I'm working on a Sandbox based Wordpress theme and I would like to add a home link as a first item in the navigation. I know I should change the function in "sandbox_globalnav" in the functions.php file, which is:

// Produces a list of pages in the header without whitespace
function sandbox_globalnav() {
if ( $menu = str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages('title_li=&sort_column=menu_order&echo=0') ) )
    $menu = '<ul>' . $menu . '</ul>';
$menu = '<div id="menu">' . $menu . "</div>\n";
echo apply_filters( 'globalnav_menu', $menu ); // Filter to override default globalnav: globalnav_menu

}

However, my PHP skills are really basic and I'm not sure where I should override this.

Thanks!


Solution

  • Upgrade to WordPress 3.0 and you'll find a built in menu creator. No PHP knowledge needed. This should work in modifying the navigation for most themes.