Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter leejk_sun

    (@leejk_sun)

    This 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.

    Thread Starter leejk_sun

    (@leejk_sun)

    Thanks 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.

Viewing 2 replies - 1 through 2 (of 2 total)