Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
wordpress中的谷歌adsense_Wordpress_Conditional - Fatal编程技术网

wordpress中的谷歌adsense

wordpress中的谷歌adsense,wordpress,conditional,Wordpress,Conditional,我使用wordpress和最近使用的adsense。根据GoogleAdSense的建议,我试图通过在标题中使用以下代码来删除不必要页面上的广告 <?php if ( !is_page(array('29460', '32349')) || !is_404() || !is_preview() ) :?> //GOOGLE ADSENSE CODE BLOCK <?php endif;?> //谷歌ADSENSE代码块 代码似乎不能与所有这些条件一起工作,你知道

我使用wordpress和最近使用的adsense。根据GoogleAdSense的建议,我试图通过在标题中使用以下代码来删除不必要页面上的广告

<?php if ( !is_page(array('29460', '32349')) || !is_404() || !is_preview() ) :?>

//GOOGLE ADSENSE CODE BLOCK

<?php endif;?>

//谷歌ADSENSE代码块
代码似乎不能与所有这些条件一起工作,你知道我应该如何重新构造代码以使其工作吗?

假设你想隐藏ID29460页、ID32349页、404页和预览页上的Adsense块,你应该使用
&
而不是
|

<?php if ( !is_page(array('29460', '32349')) && !is_404() && !is_preview() ) :?>

//GOOGLE ADSENSE CODE BLOCK

<?php endif;?>

//谷歌ADSENSE代码块

亲爱的投票人,请您分享一下您行动背后的逻辑。这个问题应该以哪种方式获得否决票?谢谢,伙计,它奏效了。我认为操作符
&&
的意思是,只有在所有条件都匹配的情况下。