首页    >    中文手册    >   常用函数-get_category_template()

常用函数-get_category_template()

常用函数-get_category_template()

说明

检索当前模板或父模板的类别模板路径。

通过检索当前类别编号(如’category-1.php’)可查到该类别的模板路径,若类别编号不存在,则退回category.php模板。

用法

<?php get_category_template() ?>

参数

返回的值

(字符串)

返回当前模板或父模板的类别模板路径。

示例

注释

  • 用法:apply_filters()在类别模板路径上调用’category_template’
    用法:locate_template()
    用法:在’cat’上调用get_query_var()get_query_var()

修改记录

自1.5.0版本后

源文件

get_category_template()位于 wp-includes/theme.php中。

相关资源

分类:中文手册

* 版权声明:作者WordPress啦! 转载请注明出处。