where exactly is this home2.php? Is it in your theme?
wp-content -> themes -> your_theme -> home2.php ??
yes… you guessed it right.
Hm… I’m not sure why changing the name would kick up those errors…
But it may have something to do with how your particular theme is configured. What theme are you using?
home.php does a very specific thing… it has a function based on the name. home2.php would not have that function. I’m not sure that adding a 2 to the name should cause any issue, but under what circumstances are you using the template? Because wp wouldn’t natively go hunting for a file named home2.php, so you must be using it a certain way for it to be called….
You’re probably already familiar with how templates are called, but just in case
http://codex.ww.wp.xz.cn/Template_Hierarchy
And then to understand the includes
http://codex.ww.wp.xz.cn/Include_Tags
I’m just not sure what, in your situation, would be blocking the includes from working. That should only happen if you are somehow visiting the template without the WP environment being loaded….
“wp wouldn’t natively go hunting for a file named home2.php”
yea… true… it’s all configured to be home.php.. not home2.php
My question is: where is that configuration file?
I want to be in control of it… not it controlling me :/
That configuration file is making the includes implicitly.. I admit that this method is modular inorder to fit with the fact wp uses various themes, indeed..
Still, again, I want to control the includes structure of my own website.. with the help of wp, of course 🙂
any other help, please?
http://core.trac.ww.wp.xz.cn/browser/tags/3.3.1/wp-includes/general-template.php
so wp-includes -> general-template.php is where the includes get defined.
I’m still trying to figure out how you are using home2.php, because no matter the name of the template, if you are using a file within WP, get_header will always load the header, and not come back as undefined. Unless you are doing something outside of WP, in which case the definitions wouldn’t be laoded, you’d have to include the WP environment.
NOTE: By linking that file above, I’m most certainly not encouraging any editing of core WP files, which is a big no no, and causes much grief and gnashing of teeth!
I tried to edit the core of WP before… missed up everything back then… lool
Here is what I tried now…
I fetched the definition of all needed functions manually and copied them literally into my new home2.php …
As u said, get_header() is in “wp-includes/general-template.php” indeed (so as get_footer())
Sadly enough, those two functions are also using other wp function from other php files inside wp-includes!
Sooooo…. I continued copying (load-template(), …etc)… until I reached those two functions, require() and require_once(), and got long-description errors….
So I called it a truce until some other time :/