How to Show Home Page Link in WordPress 3.0 Menu

Posted on August 5th, 2010 by in Themes | 26 Comments  
How to Show Home Page Link in WordPress 3.0 Menu

When WordPress 3.0 was launched, many people did not know about how to add a home page link in the WordPress 3.0 Menu. The simple solution was to add home-page link as a Custom Link to the menu. Well in this article, we will show you how you can show home page link under the pages widget in WordPress 3.0 menu system. This is something that all theme developers should have in their WordPress 3.0 compatible themes.

First open your theme’s functions.php file and paste the following code:

function home_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'home_page_menu_args' );

Once you have pasted this code, It should add “Home” as an option under the “Pages” widget on the Menu management page so the user can simply check it off as an item to add to their custom menu.

How to Show Home Page Link in WordPress 3.0 Menu

About

Editorial Staff at WPBeginner mainly Syed and David.

Post comment as twitter logo facebook logo
Sort: Newest | Oldest
SureshK.Chaudhary 5 pts

which is the best wordpress version???

fatemusiclive 5 pts

ok ive found it so ignore the comment below, but it doesnt seem to work :S help! lol

wpbeginner 50 pts moderator

fatemusiclive If you are using WordPress.com then you won't have that file available.

fatemusiclive 5 pts

i dont seem to have a function.php file under themes editor (unless its somewhere else and ive got it wrong and u can direct me lol) can i just add it into the style sheet?

staytrue106 5 pts

Thank you so much for posting this. I added the homepage before on another wordpress site I had created, but couldn't remember how I did it (it was also an earlier version of wordpress too). Your post worked perfectly! thank you :-)

sarahkovac 5 pts

SOOO glad I found this! I had no idea what I was doing and you made it so simple. THANK YOU!

thiago.trr.kta 5 pts

just FANTASTIC man! you saved me lots of time! thank you very much!

Thank you - this worked great.

However ... now I want to *remove* it as an option (ie back to no 'Home' option) but it won't go away. I tried the following ...
1) removed the code from functions.php
2) changed $args['show_home'] = true; to $args['show_home'] = false;
3) hard-refreshed the browser on the admin Menus page
4) logged out/in of wp-admin
5) copied the original functions.php back from twentyten
... but it's still listed under "View All"

Any suggestions?

Good trick. Or one can also insert a custom link by typing website.com and then there you go :) But clients who don't understand all this, will find this trick helpful.

Yes, this generates the home page link and it is dynamic.

Does the home page link work in Wp 3.1.1?

Yes... it should work fine.

Thanks. Work great!

Somebody mentioned about if sites URL changes. I use a solitary / when linking to my home page. Don't know if this good practice but it works.

This is great - thank you.

What happens though if the site is in development and the URL of the site changes? Will the "Home" link be automatically updated?

Is there a way to embed a shortcode into the menu item so that the home URL will always be current?

The home url value is coming from your Settings that you have set. If you change that URL, then yes it will change. You can set a custom class for home by clicking edit on the home link in the menu.

It looked simple to do, but no matter where I put that code in the theme's function.php file, it doesn't work.

Any clues as to why that might be?

Are you clicking on the View All tab? This code is working on a lot of our client's sites.

Hi,
You still haven't answered Sheila's question - where in the Functions.php file do we place this code?
Thanks!

Sheila says:
November 11, 2010 at 11:44 am
It looked simple to do, but no matter where I put that code in the theme’s function.php file, it doesn’t work.

Any clues as to why that might be?
Reply

*
Editorial Staff says:
November 12, 2010 at 4:54 pm

Are you clicking on the View All tab? This code is working on a lot of our client’s sites.

You place this code within the php tag anywhere in the functions.php file.

Awesome, thank you so much! I was looking all over for the solution!

Thank you wpbeginner. Details like these make us more comfortable working with WordPress.

Nice and simple trick.thank you

I love love love the articles on wpbeginner.com
Keep them coming...now I only have to switch my own website from .net to wordpress.

But for that to happen I have to build first my own plugin to submit table tennis scores.

Shouldn't be hard to build that plugin ;) Let us know once you make the plugin :)

Tweets about us: