函数原型:
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工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

css3做一个风雨雷电天气动态图标
利用js+css3做一个小鱼游泳特效
3d文字360度旋转
一起去看流星雨(代码)
HTML5 Canvas 刻度尺
canvas黑洞漩涡(canvas+js)
css3卡片动态滑动效果
canvas经线动画走到效果







