条件if语句/is_page在WordPress 3.0中不起作用

我已经尝试了多种变体, 但我知道这在我加入is_home时仍然有效, 即使那不是我要实现的目标, 但它会在每个页面上显示它……如果我尝试其他类似is_front_page或类似的东西我在下面的示例中, 这是我实际上想要实现的目标, 但是没有(工作!)。有人可以帮忙吗?

<?php if (is_page('about')) { ?>
    <div id="testimonial-block" class="sidebar-block clearfix">
    <h4>Testomonials</h4>
    <p>"I feel so much more motivated and in control of my life. The coaching has given me the time to think about what I really wanted to achieve and how I can make it happen. I have been completely blown away by how much I have enjoyed coaching with Becky and embraced the concept across my whole life."<br />
    <small>Caroline Rowe, <br />
    Communications Manager</small></p>
    </div>
    <?php } ?>

#1


固定它!它放在<?php wp_reset_query();中?>


#2


代码看起来不错。

is_page()函数进行区分大小写的字符串比较(我相信)。

检查字母大写字母是否正确。

来源:

https://www.srcmini02.com/67216.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_40159.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?