1. 主页
  2. 文档
  3. WordPress函数
  4. get_home_template

get_home_template

get_home_template

https://developer.wordpress.org/reference/functions/get_home_template/

调用当前模板或父模板的home模板文件home.php

if ( 'posts' == get_option( 'show_on_front' ) ) {
    include( get_home_template() );
}

首先尝试调用'home.php' ,如果找不到则调用 'index.php'

用法:

<?php get_home_template() ?>

返回值:

(string) 

当前模板或父模板的home模板。

这篇文章对您有用吗?

我们要如何帮助您?