开发者

Hiding a DIV in sidebar in Wordpress

开发者 https://www.devze.com 2022-12-18 11:05 出处:网络
I want to hide this specific in the blog and other page I have this code : <?php if (is_page(array (\'2\',\'4\',\'6\',\'8\',\'10\',\'12\'开发者_运维问答))) : ?>

I want to hide this specific in the blog and other page I have this code :

<?php if (is_page(array ('2','4','6','8','10','12'开发者_运维问答))) : ?>
<?php else : ?>
<?php include('stats.php');?>
<?php endif; ?>

it won't show on 2,6,8,10,12 which are the pages but it shoes in 4 which is the blog please help.


Assuming 'blog' is a category, and it's ID is 4 and you don't want to include 'stats.php' when viewing that category's archive page:

<?php if (!is_page(array('2','4','6','8','10','12')) && !is_category('4')) {
    include('stats.php');
} ?>

Otherwise, refer to the documentation for Wordpress conditional tags.

0

精彩评论

暂无评论...
验证码 换一张
取 消