Template Hierarchy in Codex – https://codex.wordpress.org/Template_Hierarchy
Template Hierarchy – https://developer.wordpress.org/themes/basics/template-hierarchy
Разница между front-page.php
page.php
home.php
index.php
codex – https://developer.wordpress.org/themes/basics/template-hierarchy/#front-page-display
The front-page.php
template file is used to render your site’s front page, whether the front page displays the blog posts index (mentioned above) or a static page. The front page template takes precedence over the blog posts index (home.php
) template. If the front-page.php
file does not exist, WordPress will either use the home.php
or page.php
files depending on the setup in Settings → Reading. If neither of those files exist, it will use the index.php
file.
front-page.php
– Used for both “your latest posts” or “a static page” as set in the front page displays section of Settings → Reading.home.php
– If WordPress cannot findfront-page.php
and “your latest posts” is set in the front page displays section, it will look forhome.php
. Additionally, WordPress will look for this file when the posts page is set in the front page displays section.page.php
– When “front page” is set in the front page displays section.index.php
– When “your latest posts” is set in the front page displays section buthome.php
does not exist or when front page is set butpage.php
does not exist.
Если существует файл front-page.php он будет показываться при вызове главной страницы сайта
Если front-page.php в теме нет
– настройка главной страницы – “Ваши последние записи”, WordPress ищет home.php, если его тоже нет будет вызываться index.php
– настройка главной страницы – “Статическая страница”, WordPress ищет page.php, если его тоже нет будет вызываться index.php
Если front-page.php существует у него максимальный приоритет – он показывается всегда, не смотря на наличие/отсутствие home.php или page.php