Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
WordPress 具有条件函数,例如is_front_page()或 is_home()测试网站上当前加载的内容。
is_front_page()
is_home()
如果显示错误页面,是否有一些类似的功能可以测试?
is_404() 函数?我想这就是你需要的。
http://codex.wordpress.org/Function_Reference/is_404