函数文档

get_paged_template()

💡 云策文档标注

概述

get_paged_template() 函数用于获取当前或父主题中分页模板的路径,但自 WordPress 4.7.0 起已被弃用,因为 paged.php 模板不再属于主题模板层次结构。

关键要点

  • 函数返回分页模板文件的完整路径字符串。
  • 该函数在 WordPress 4.7.0 中被弃用,使用 _deprecated_function() 标记。
  • 内部调用 get_query_template('paged') 来获取模板路径。
  • 相关函数包括 get_query_template() 和 _deprecated_function()。

注意事项

自 WordPress 4.7.0 起,paged.php 模板不再属于主题模板层次结构,开发者应避免使用此函数,转而使用其他模板查询方法。


📄 原文内容

Retrieve path of paged template in current or parent template.

Return

string Full path to paged template file.

Source

function get_paged_template() {
	_deprecated_function( __FUNCTION__, '4.7.0' );

	return get_query_template( 'paged' );
}

Changelog

Version Description
4.7.0 Deprecated. The paged.php template is no longer part of the theme template hierarchy.
1.5.0 Introduced.