函数原型:
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工作流
树上挂着一只快乐香蕉ComfyUI工作流一
葡萄庄园白葡萄酒ComfyUI工作流
水晶玉雕巨龙ComfyUI工作流
一只千纸鹤坐在路上哭泣ComfyUI工作流
一座古老的石阶,旁边有一棵树
一个时间旅行女人的神秘剪影ComfyUI工作流
奋斗的小黄人ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

纯CSS饼图效果
html5如何3D立方体旋转特效
一起去看流星雨(代码)
js导出excel插件(兼容mac电脑Numbers表格)
canvas经线动画走到效果
javascript如何利用draggable实现一个拖拽效果
利用CSS3代码编写45款按钮效果











