admin管理员组

文章数量:1201374

I've inherited a theme and am trying to get my head around a plugin failure.

There is an index.php file in the root of the theme, is that the first file wordpress will look at when it attempts to resolve the homepage or maybe it is something else?

All files in the the root are as follows:

404.php
archive-jetpack-testimonial.php
archive.php
assets
comments.php
footer.php
front-page.php
functions.php
header-front.php
header.php
inc
index.php
page.php
rtl.css
screenshot.png
search.php
secure.php
sidebar.php
single.php
style.css
style.css.map
template--standard.php

With which file does wordpress begin?

I've inherited a theme and am trying to get my head around a plugin failure.

There is an index.php file in the root of the theme, is that the first file wordpress will look at when it attempts to resolve the homepage or maybe it is something else?

All files in the the root are as follows:

404.php
archive-jetpack-testimonial.php
archive.php
assets
comments.php
footer.php
front-page.php
functions.php
header-front.php
header.php
inc
index.php
page.php
rtl.css
screenshot.png
search.php
secure.php
sidebar.php
single.php
style.css
style.css.map
template--standard.php

With which file does wordpress begin?

Share Improve this question asked Sep 7, 2018 at 17:22 SeanJSeanJ 1671 silver badge8 bronze badges 2
  • What is the "inc" entry? – MrWhite Commented Sep 7, 2018 at 19:33
  • 1 Technically, with style.css to determine the name of the theme and whether it's a child theme, and whether it's the theme that the blog is configured to use. – Michael Hampton Commented Sep 7, 2018 at 23:02
Add a comment  | 

2 Answers 2

Reset to default 5

If it's the home page, WordPress will look for the following files in this order and use the first one it finds:

1. front-page.php
2. home.php
3. index.php

WordPress template hierarchy is described in detail here:

https://developer.wordpress.org/themes/basics/template-hierarchy/

This article explains how WordPress determines which template file(s) to use on individual pages. If you want to customize an existing WordPress theme it will help you decide which template file needs to be edited.

I think the more logical path is this:

  1. style.css
  2. functions.php
  3. index.php

本文标签: What is the first file wordpress looks at in a theme