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

时间:2011-02-23 17:37:08

标签: php wordpress

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

我的主页标题使用的是与我的single_page标题不同的类 他们使用2个不同的CSS ID。

现在我的主页在header.php中使用了 但我想要它做的是当你在页面上时显示 (is_page)我该怎么做?

1 个答案:

答案 0 :(得分:0)

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

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

这个问题也可以帮到你:Detect the browsed page from url in wordpress

相关问题