函数原型:
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工作流
一桌精致的美食,桌上几杯白葡萄酒
令人着迷的一只老虎ComfyUI工作流
池塘边的大熊猫ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

一起去看流星雨(代码)
制作一个好玩的倒计时
3D彩色卡片
html5如何3D立方体旋转特效
用canvas实现画板涂鸦效果
barcode条形码/qrcode二维码兼容所有浏览器(含ie6/ie7/ie8)
2023年程序猿如何给自己开启一场烟花盛会
用ascii字符画图像










