繁体   English   中英

Wordpress header.php根据页面显示不同的CSS?

[英]Wordpress header.php displaying different CSS depending on page?

我目前正在将我的网站转换为wordpress网站..并且遇到了问题

我首页的标头使用与single_page标头不同的类。它们使用2个不同的CSS ID。

现在我有正在使用的主页 在我的header.php里面,但是我想要做的是显示 当您在页面(is_page)上时,我该怎么做?

您需要的是条件标签: http : //codex.wordpress.org/Conditional_Tags

if (is_page()) { do this }
elseif (is_front_page()) { do that }
else { do nothing? }

这个问题也可以帮助您: 从wordpress中的url检测浏览的页面

暂无
暂无

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

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