首页 > wp_footer();括号里面能添加参数吗?

wp_footer();括号里面能添加参数吗?

wordpress下 想做一个判断,如果是手机访问网站,footer只获取PC端footer的一部分信息入“all rights reserved .”
代码如下:
<div id="down-footer">

<div class="container">
    <div class="footer-basics">
    <p>© 2015 <a href="http://www.phiops.com"> Phiops.com </a> , all rights reserved . </a><a title="本站点采用知识共享署名-非商业性使用-相同方式共享 3.0 中国大陆许可协议进行许可,转载本站文章,请注明出处" href="http://creativecommons.org/licenses/by-nc-sa/3.0/cn/" target="_blank"><img src="http://phiops-index-img.b0.upaiyun.com/main/cc-by-nc-sa.png" ></a></p>
    </div>
    <div class="footer-links">
    <a href="http://blog.phiops.com/qa"> 问答 </a>&nbsp;<a href="http://blog.phiops.com/about"> 关于 </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </div>
</div>

</div>
<?php if( IsMobile ){?>
<script type="text/javascript">

var _id = function(_){
    return document.getElementById(_)
};
                
_id("mobile-menu").onclick = function(){
    if( _id("header").className == "selected" ){
        _id("header").className = ""
    }else{
        _id("header").className = "selected"
    }
};

for(var i=0; i< document.images.length; i++){
    document.images[i].removeAttribute("width");
    document.images[i].removeAttribute("height");
}

</script>
<?php }?>
<?php wp_footer(); ?>


get_footer()函数用于包含当前主题公共底部footer.php模板文件。当然我们也可以指定底部文件名用于不同页面指定不同底部模板,格式为:footer-{$name}.php。
在页面里对应位置更改:
<?php
if ( is_home() ) :

get_footer('home');

elseif ( is_404() ) :

get_footer('404');

else :

get_footer();

endif;
?>

【热门文章】
【热门文章】