leejk_sun
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Index.php is loading before Home.phpThis question really stems from this paragraph (from https://codex.www.ads-software.com/Template_Hierarchy#Examples):
“If a visitor goes to your home page at https://example.com/wp/, WordPress first determines whether it has a static front page. If a static front page has been set, then WordPress loads that page according to the page template hierarchy. If a static front page has not been set, then WordPress looks for a template file called home.php and uses it to generate the requested page. If home.php is missing, WordPress looks for a file called index.php in the active theme’s directory, and uses that template to generate the page.”
When they cite this url: “https://example.com/wp/” it makes me inclined to believe that the Template Hierarchy in this case (but hopefully not others) will only work in sub-directory installations of WordPress.
Forum: Themes and Templates
In reply to: Index.php is loading before Home.phpThanks for the reply!
I understand that the server will look for index.php first, but as I understand how WordPress works, the server will find index.php in the root of the instance (which defines() the theme and calls wp-blog-header.php), then draws out all the theme templates from the theme folder.
Inside that theme folder I have an index.php file (as required) and a home.php file. If I am understanding the template hierarchy correctly, when the index.php file in the root of the instance calls the templates in the theme folder, it should load up what I have in home.php instead of index.php.