Skip to main content
We are Brand SEO Beijing serving international business, your marketing partner, Contact us by mi@mgsh.com.cn

Site Structure CMS Hierarchy Hierarchy

Wordpress Structure - Brand - SEO - Public Opinion - Optimization -米国生活Wordpress Structure Marking-Brand-SEO-Public Opinion-Optimization-米国生活
Image source: https://wphierarchy.com/

For the following table, one is body class, and the other is is_home and is_page. Let’s have a good understanding. To sum up, home.php will be used when outputting blog content in a loop. Font-page.php is the real homepage. Leverage the priority!
 Default
default
 Static front page
When fixed page is selected
Front page displays
How to display the home page
Your latest posts
recent blog posts
Front page:
FrontHome style
Posts page:
Posts blog style
URL
Domain name style
example.com
(site URL) website domain name
example.com/posts
(page URL) page pseudo-static domain name
Template hierarchy
Template level
front-page.php
使用font-page.php模板
home.php
使用home.php模板
home.php
Missing front-page.php will
go find home.php
Search from top to bottom, use whoever you find
  • $custom.php
  • page-$slug.php
  • page-$id.php
  • page.php
  • singular.php
index.php
命根子模板index.php
Body classes
The class style name of the front page body tag
  • home
  • blog
  • home
  • page
  • page-id-$id
blog
Loop and content
Template content
posts index page posts index
home_url()
内置函数的值
example.com
get_post_type_archive_link('post') example.com example.com/posts
is_front_page()
Built-in logical judgment function
true false
is_home()
Built-in logical judgment function
true false true
is_page()
Built-in logical judgment function
false true false
get_option( 'show_on_front' ) 'posts' 'page'
get_option( 'page_on_front' ) 0 Front page ID
get_option( 'page_for_posts' ) 0 Posts page ID
 
Back to Top