Link to home
Start Free TrialLog in
Avatar of the_sleeper
the_sleeperFlag for United States of America

asked on

Question: Confusion with home.php and Navigation Menus

Ok,

1. I'm working through a tutorial on Creating Custom Themes in WordPress (Translation: I'm green! Please take that into consideration).
2. I've added a home.php page which should override my index.php file (right?).
3. When I go to the rootsite (www.site.com), I SEE home.php

The problem....

4. My theme also has a Nav which I've created in the WP Admin section and which I've registered in functions.php.
5. In order to HAVE a "homepage" (in the Nav), I had to add a NEW page to WordPress. So... now I have TWO home pages: home.php (which I've styled up and laid out) AND homepage which I generated in WP Admin.  
6. When I created the nav, home.php was not available but the homepage I created in the admin IS listed.That's (apparently) all i can use.
7. So, my nav now points to a different homepage then the one I created (and want to show).
8. When I click the home link (from my nav), it shows posts (apparantly pulled from the generic "page.php"), NOT my fancy laid out page (as in "home.php")

...so...

Questions:

1. How can i get the link in the left nav (built in WP Admin) to show the same page as home.php
2. Or, do I need to (in someway) duplicate home.php and show it on the homepage I created to use the WP Admin Nav Tools?

please advise.
Avatar of the_sleeper
the_sleeper
Flag of United States of America image

ASKER

Update: I created a custom link in the nav which pointed to the main page of the site. That works, but I'm not sure if that is the proper WordPress way to do it. As I said iIm pretty green on WordPress.
I don't see why that would be a problem. That's what I would have done. Good work.

If you plan on allowing others to use the theme it could be a little confusing to the person using it. If you plan on selling, or offering it for free you may reconsider the setup.

Did your custom page require a different header set-up? If not just use the get header command in the custom page template..
There's a better way of creating the Home item in the navigation menu.

If you've created your theme to support it,  Appearance-> Menu will create your menus simply. The link below describes directly adding your home page (whatever it is) to the menu by clicking on "View All" under "Pages" and adding the home item to your custom menu.

http://codex.wordpress.org/Appearance_Menus_SubPanel#Pages


If you don't want to use custom menus, you can also create your Home link using the wp_page_menu() function's parameter "show_home"

http://codex.wordpress.org/Function_Reference/wp_page_menu
I think the custom menu is what is currently being used.
Perhaps I should explain the fix more clearly

1. I went to the custom menu section in the admin
2. I created a link to www.site.com AS a custom menu item with a title of Home.
3. I then added that Custom Link to the Main Menu and positioned it.

hope this explains my "fix".

Is there a better (i.e. standard) way to fix?

please advise.
ASKER CERTIFIED SOLUTION
Avatar of SonicVoom
SonicVoom
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok, I get it! Thanks everyone.