繁体   English   中英

is_home()和is_front_page()在Wordpress Widget Logic插件中不起作用

[英]is_home() and is_front_page() doesn't work in Wordpress Widget Logic plugin

我试图通过使用以下条件标签在我的博客主页上显示AdRotate内容: is_home() && is_front_page()以及其他is_home() || is_front_page() is_home() || is_front_page()无效。 如果我在header.php这样做: echo is_home(); 结果我得到1,这使我认为这是对的。 另外,如果我尝试使用echo is_front_page()is_front_page()得到相同的结果。 那怎么了

is_home() && is_front_page()始终为false。 两者是互斥的。 第二个版本是正确的用法: is_home() || is_front_page() is_home() || is_front_page() 您是否知道is_home()is_front_page()之间的区别?

查看插件常见问题页面以获取有关首页使用情况的更多信息: http : //wordpress.org/plugins/widget-logic/faq/

还要进一步阅读您尝试使用的条件: http : //codex.wordpress.org/Function_Reference/is_home http://codex.wordpress.org/Function_Reference/is_front_page

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM