Default默认 | Static front page当选择固定页面时 | ||
---|---|---|---|
Front page displays首页显示方式 | Your latest posts最近博文 | Front page: Front首页样式 | Posts page: Posts博文样式 |
URL域名样式 | example.com (site URL)网站域名 | example.com/posts (page URL)页面伪静态域名 | |
Template hierarchy模板层级 | front-page.php 使用font-page.php模板 | home.php 使用home.php模板 | |
home.php 缺少front-page.php就会去寻找home.php | 从上至下依次找,找到谁就用$custom.php page-$slug.php page-$id.php page.php singular.php | ||
index.php 命根子模板index.php | |||
Body classes前台网页body标签的class样式名 | home blog | home page page-id-$id | blog |
Loop and content模板内容 | posts index | page | posts index |
home_url() 内置函数的值 | https://example.com | ||
get_post_type_archive_link('post') | https://example.com | https://example.com/posts | |
is_front_page() 内置逻辑判断函数 | true | false | |
is_home() 内置逻辑判断函数 | true | false | true |
is_page() 内置逻辑判断函数 | 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 |