How does WordPress route index.php when a front-page.php is present in the theme?

I just set up a wp theme featuring a front-page.php.

When I point my browser to http://mydomain.com/ the front-page.php is loaded. That’s ok.

Read More

But… which URL will now trigger the index.php template?

Thank you in advance for your feedback.

Matteo

Related posts

Leave a Reply

1 comment

  1. index.php is the main file for the theme. It contains the code for the Main Area (below header & above footer) and will specify where the other files will be included.

    Your site may be loading front-page.php because you may have set static page in your settings to be shown as home page.

    Acording to wordpress official doc:

    index.php
    The main template. If your Theme provides its own templates, index.php must be present.

    front-page.php
    The front page template, it is only used if you use a static front page.

    home.php
    The home page template, which is the front page by default. If you use a static front page this is the template for the page with the latest posts.


    See this Link for more details on wordpress template hierarchy: WordPress Codex « Theme Development « Template File List

    Having said that, mention your site URL in question and may be I can help you more.