php getfooter,wordpress函数get_footer()用法示例
get_footer( string $name = null )
Load footer template.
描述
Includes the footer template for a theme or if a name is specified then a specialised footer will be included.
For the parameter, if the file is called "footer-special.php" then specify "special".
参数
$name
(string)
(Optional)
The name of the specialised footer.
Default value: null
源代码
File: wp-includes/general-template.php
function get_footer( $name = null ) {
/**
* Fires before the footer template file is loaded.
*
* The hook allows a specific footer template file to be used in place of the
* default footer template file. If your file is called footer-new.php,
* you would specify the filename in the hook as get_footer( 'new' ).
*
* @since 2.1.0
* @since 2.8.0 $name parameter added.
*
* @param string|null $name Name of the specific footer file to use. null for the default footer.
*/
do_action( 'get_footer', $name );
$templates = array();
$name = (string) $name;
if ( '' !== $name ) {
$templates[] = "footer-{$name}.php";
}
$templates[] = 'footer.php';
locate_template( $templates, true );
}
更新日志
Version
描述
1.5.0
Introduced.
相关函数
Uses
wp-includes/general-template.php:
get_footer
wp-includes/plugin.php:
do_action()
wp-includes/template.php:
locate_template()
Skip to note content
You must log in to vote on the helpfulness of this noteVote results for this note: 2You must log in to vote on the helpfulness of this note
Contributed by Codex
Multi footers
Different footer for different pages.
if ( is_home() ) :
get_footer( 'home' );
elseif ( is_404() ) :
get_footer( '404' );
else :
get_footer();
endif;
?>
The file names for the home and 404 footers should be footer-home.php and footer-404.php respectively.
Simple 404 page
The following code is a simple example of a template for an “HTTP 404: Not Found” error (which you could include in your theme as 404.php).
Error 404 - Not Found
php getfooter,wordpress函数get_footer()用法示例相关推荐
- php中mimes函数,wordpress函数check_upload_mimes()用法示例
check_upload_mimes( array $mimes ) Check an array of MIME types against a whitelist. 描述 WordPress sh ...
- add php support,wordpress函数add_post_type_support()用法示例
add_post_type_support( string $post_type, string|array $feature ) Register support of certain featur ...
- PHP Calendar 函数,wordpress函数get_calendar()用法示例
get_calendar( bool $initial = true, bool $echo = true ) Display calendar with days that have posts a ...
- escilpe mysql,wordpress函数esc_sql()用法示例
esc_sql( string|array $data ) Escapes data for use in a MySQL query. 描述 Usually you should prepare q ...
- php geteditor,wordpress函数get_editor_stylesheets()用法示例
get_editor_stylesheets() Retrieve any registered editor stylesheets 描述 返回值 (array) If registered, a ...
- php函数clean(),wordpress函数clean_url()用法示例
Warning: This function has been deprecated. Use esc_url() instead. clean_url( string $url, array $pr ...
- ?php get_sidebar(); ?,wordpress函数get_sidebar()用法示例
get_sidebar( string $name = null ) Load sidebar template. 描述 Includes the sidebar template for a the ...
- html class函数,wordpress函数sanitize_html_class()用法示例
sanitize_html_class( string $class, string $fallback = '' ) Sanitizes an HTML classname to ensure it ...
- php theexcerpt,wordpress的excerpt()函数的用法示例
本篇文章给大家带来的内容是关于wordpress的excerpt()函数的用法示例,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. 问题:在wordpres中的single页面,本身引 ...
最新文章
- Windows性能调优: Perfomn.exe 和Perfmon /res
- postman自动打开_postman第1讲-开篇:介绍与安装
- matlab 批量缩小图片
- linux cant open file for writing,linux 安装rz sz lrz lsz sftp: cannot open 文件名称 to write 报错解决...
- msSql 利用 xp_cmdshell 删除 创建目录
- Linux下MySQL数据库常用基本操作 一
- Android单选中listview中的一项
- LinkedList的源码分析(基于jdk1.8)
- 有了它,Java语法也可以变得甜甜的
- excel导入,用反射匹配字段名
- 0006 求三个数的平均数
- Python学习之——列表、字典、实验低配版非诚勿扰
- 财会法规与职业道德【18】
- Sklearn-scaler对比
- Shiro-02-subject与session
- Linux常见Bug解决方案
- 上周,维(系数字世界真)谛技术开了个大会
- 高考必胜|东方星书法祝全体考生旗开得胜,金榜题名
- 中间件之实习四 Web Services 开发
- 华润杜邦物流信息化案例