【问题标题】:Wordpress header.php displaying different CSS depending on page?Wordpress header.php 根据页面显示不同的 CSS?
【发布时间】:2011-02-23 17:37:08
【问题描述】:

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

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

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

【问题讨论】:

    标签: php wordpress


    【解决方案1】:

    你需要的是条件标签: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

    【讨论】:

    • 我知道条件标签,但我不确定要传递什么参数和东西..
    猜你喜欢
    • 1970-01-01
    • 2012-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多