Solved

Question: Confusion with home.php and Navigation Menus

Posted on 2011-03-19
7
280 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:the_sleeper
  • 3
  • 2
  • 2
7 Comments
 

Author Comment

by:the_sleeper
ID: 35173421
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.
0
 
LVL 23

Expert Comment

by:jeremyjared74
ID: 35173453
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..
0
 
LVL 2

Expert Comment

by:SonicVoom
ID: 35173484
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
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 23

Expert Comment

by:jeremyjared74
ID: 35173494
I think the custom menu is what is currently being used.
0
 

Author Comment

by:the_sleeper
ID: 35173796
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.
0
 
LVL 2

Accepted Solution

by:
SonicVoom earned 500 total points
ID: 35173830
First, remove your custom link. We can point specifically to whatever loads as home/site root.

Custom Menu > Pages box:
"Links to specific pages can be added to the menu. Three tabs, Most Recent, View All, and Search, determines what posts are displayed for selection as a menu item. When the View All tab is displayed, a Home choice, while not an actual page, also becomes available to add to the menu. The Checkbox, Select All, and Add to Menu options, describe in the Posts section, are also displayed in this module. "

(from http://codex.wordpress.org/Appearance_Menus_SubPanel#Pages )
0
 

Author Comment

by:the_sleeper
ID: 35173897
Ok, I get it! Thanks everyone.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
WordPress, AWS and memory starvation 5 85
WordPress Child Theme Issue 19 38
Customizing themes 14 47
Wordpress syntax error 1 29
I want to start by talking about the use of plug-ins for WordPress. I started a web-site for a company I was working for a few years ago; I had extremely basic knowledge of HTML. I am a Graphic Designer by trade so I invited the opportunity as a cha…
Wordpress Horizontal Drop-Down Menu In this tutorial I will show you had to add a WordPress horizontal navigation menu to your theme. I have searched and searched for a good tutorial on creating a WordPress nav menu without adding a plug-in or us…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now