函数原型:
get_footer( string $name = null, array $args = array() ): void|false
包含主题的页脚模板,或者如果指定了名称,则将包含专用页脚。对于参数 $name,如果文件名为“footer-special.php”,则应指定 $name 为:“special”。
参数说明:
$name,指定 header 模板的名称,如果为空则加载 footer.php。如果 $name=’special’,则加载 footer-specific.php 。
$args,传给 header 模板的参数。
函数源码:
function get_footer( $name = null, $args = array() ) {
do_action( 'get_footer', $name, $args );
$templates = array();
$name = (string) $name;
if ( '' !== $name ) {
$templates[] = "footer-{$name}.php";
}
$templates[] = 'footer.php';
if ( ! locate_template( $templates, true, true, $args ) ) {
return false;
}
}
包含钩子:
do_action( 'get_footer', string|null $name, array $args )
使用举例:
<?php if ( is_home() ) : get_footer( 'home' ); elseif ( is_404() ) : get_footer( '404' ); else : get_footer(); endif; ?>
上面是“wordpress建站:怎么利用get_footer加载尾部模板文件”的全面内容,想了解更多关于 wordpress 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_4226.html
workflows工作流
一名男子跪在月球岩石表面看见小行星碰撞
在地铁站里一个迷茫的非主流姑娘
五彩斑斓的蛇状飞鸟
一张精心制作的熊岛复古地图ComfyUI工作流
一位身穿金色铠甲的美丽女子守卫在寺庙外
一个超现实和超现实的场景,在森林中心有一座蛇形的房子
3d卡通风格多彩头发的女人
一个黑人在森林中穿着折纸的衣服ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

利用CSS3做一个星级评分样式
如何利用svg做一个有趣的loading动画加载
3D立体人物效果
纯css翻书效果
黑客入侵效果代码
js实现下雪特效
js+css3做一个灯泡开灯关灯效果






