WordPress

推荐列表 站点导航

当前位置:首页 > 建站教程 > WordPress >

获取页脚WordPress函数get_footer用法

来源:网络整理  作者:  发布时间:2020-12-15 01:40
获取页脚WordPress函数get_footer用法,该函数位于wp-include/general-template.php文件的第61行左右的位置,代码如下。function...

* you would specify the filename in the hook as get_footer( 'new' ).

* @since 2.8.0 $name parameter added.

* Fires before the footer template file is loaded.

*/

$templates[] = 'footer.php';

PHP函数需要使用<?php ?>包裹,调用方法为:

* default footer template file. If your file is called footer-new.php,

locate_template( $templates, true );

获取页脚WordPress函数get_footer用法,该函数位于wp-include/general-template.php 文件的第 61 行左右的位置,代码如下。

}

* @since 2.1.0

$templates = array();

* @param string|null $name Name of the specific footer file to use. null for the default footer.

获取页脚WordPress函数get_footer用法 (https://www.wpmee.com/) WordPress使用教程 第1张

function get_footer( $name = null ) {

*

$templates[] = "footer-{$name}.php";

由上面的函数原型可以看出,get_footer函数需要一个字符串类型参数,并且该参数允许为空,为空时查找主题目录下footer.php文件,不存在则使用默认的 wp-includes/theme-compat/footer.php 作为页脚,不为空时查找footer-参数名.php文件作为头部。

<?php get_footer();?>

使用方法

$name = (string) $name;

if ( '' !== $name ) {

此时将加载主题目录下的footer-daimadog.php作为网站的头部文件。

*

do_action( 'get_footer', $name );

* The hook allows a specific footer template file to be used in place of the

/**

}

如传入daimadog

<?php get_footer('daimadog');?>

*

函数说明

相关热词:

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jz/wp/3967.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

获取页脚WordPress函数get_footer用法

2020-12-15 编辑:

* you would specify the filename in the hook as get_footer( 'new' ).

* @since 2.8.0 $name parameter added.

* Fires before the footer template file is loaded.

*/

$templates[] = 'footer.php';

PHP函数需要使用<?php ?>包裹,调用方法为:

* default footer template file. If your file is called footer-new.php,

locate_template( $templates, true );

获取页脚WordPress函数get_footer用法,该函数位于wp-include/general-template.php 文件的第 61 行左右的位置,代码如下。

}

* @since 2.1.0

$templates = array();

* @param string|null $name Name of the specific footer file to use. null for the default footer.

获取页脚WordPress函数get_footer用法 (https://www.wpmee.com/) WordPress使用教程 第1张

function get_footer( $name = null ) {

*

$templates[] = "footer-{$name}.php";

由上面的函数原型可以看出,get_footer函数需要一个字符串类型参数,并且该参数允许为空,为空时查找主题目录下footer.php文件,不存在则使用默认的 wp-includes/theme-compat/footer.php 作为页脚,不为空时查找footer-参数名.php文件作为头部。

<?php get_footer();?>

使用方法

$name = (string) $name;

if ( '' !== $name ) {

此时将加载主题目录下的footer-daimadog.php作为网站的头部文件。

*

do_action( 'get_footer', $name );

* The hook allows a specific footer template file to be used in place of the

/**

}

如传入daimadog

<?php get_footer('daimadog');?>

*

函数说明

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jz/wp/3967.shtml

相关文章

风云图片

推荐阅读

返回WordPress频道首页