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()用法示例相关推荐

  1. php中mimes函数,wordpress函数check_upload_mimes()用法示例

    check_upload_mimes( array $mimes ) Check an array of MIME types against a whitelist. 描述 WordPress sh ...

  2. add php support,wordpress函数add_post_type_support()用法示例

    add_post_type_support( string $post_type, string|array $feature ) Register support of certain featur ...

  3. PHP Calendar 函数,wordpress函数get_calendar()用法示例

    get_calendar( bool $initial = true, bool $echo = true ) Display calendar with days that have posts a ...

  4. escilpe mysql,wordpress函数esc_sql()用法示例

    esc_sql( string|array $data ) Escapes data for use in a MySQL query. 描述 Usually you should prepare q ...

  5. php geteditor,wordpress函数get_editor_stylesheets()用法示例

    get_editor_stylesheets() Retrieve any registered editor stylesheets 描述 返回值 (array) If registered, a ...

  6. php函数clean(),wordpress函数clean_url()用法示例

    Warning: This function has been deprecated. Use esc_url() instead. clean_url( string $url, array $pr ...

  7. ?php get_sidebar(); ?,wordpress函数get_sidebar()用法示例

    get_sidebar( string $name = null ) Load sidebar template. 描述 Includes the sidebar template for a the ...

  8. html class函数,wordpress函数sanitize_html_class()用法示例

    sanitize_html_class( string $class, string $fallback = '' ) Sanitizes an HTML classname to ensure it ...

  9. php theexcerpt,wordpress的excerpt()函数的用法示例

    本篇文章给大家带来的内容是关于wordpress的excerpt()函数的用法示例,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. 问题:在wordpres中的single页面,本身引 ...

最新文章

  1. Windows性能调优: Perfomn.exe 和Perfmon /res
  2. postman自动打开_postman第1讲-开篇:介绍与安装
  3. matlab 批量缩小图片
  4. linux cant open file for writing,linux 安装rz sz lrz lsz sftp: cannot open 文件名称 to write 报错解决...
  5. msSql 利用 xp_cmdshell 删除 创建目录
  6. Linux下MySQL数据库常用基本操作 一
  7. Android单选中listview中的一项
  8. LinkedList的源码分析(基于jdk1.8)
  9. 有了它,Java语法也可以变得甜甜的
  10. excel导入,用反射匹配字段名
  11. 0006 求三个数的平均数
  12. Python学习之——列表、字典、实验低配版非诚勿扰
  13. 财会法规与职业道德【18】
  14. Sklearn-scaler对比
  15. Shiro-02-subject与session
  16. Linux常见Bug解决方案
  17. 上周,维(系数字世界真)谛技术开了个大会
  18. 高考必胜|东方星书法祝全体考生旗开得胜,金榜题名
  19. 中间件之实习四 Web Services 开发
  20. 华润杜邦物流信息化案例

热门文章

  1. cam350 不能打开光绘文件_电子设计工程CAM350光绘工艺的一般流程
  2. Mac上解决Chrome浏览器跨域问题
  3. Echarts地图添加自定义图标
  4. PHP中的错误控制运算符
  5. ES6公用花瓣飘落插件的封装及使用,支持npm安装
  6. 位姿检索PoseRecognition:LSH算法.p稳定哈希
  7. 数据之路 Day5 - Python基础5
  8. 在Win2003、Win7、XP中配置IIS搭建ASP.NET Web网站或应用程序(1)
  9. ios动画效果集锦(持续更新)
  10. adb logcat介绍