开发者

PHP code for excluding adsense from a certain page?

开发者 https://www.devze.com 2022-12-27 18:29 出处:网络
How can I prevent adsense ads to show up on a certain page? You see, I would like to exclude adsense from displaying on the About Us page on this website, but I\'m not sure how to go about doing it...

How can I prevent adsense ads to show up on a certain page? You see, I would like to exclude adsense from displaying on the About Us page on this website, but I'm not sure how to go about doing it...

I just had a look at my index.php file and noticed that it contained the following line of code:

<div><?php echo show_ad_camp_1(); ?></div>

I'm guessing this is why I keep getting the adsense block on each and every page? So could anyone please let me know what php code I should include to get the a开发者_如何转开发ds to show up on certain pages only?


You could try this:

<div>
<?
    if (strpos("about-us", $_SERVER['REQUEST_URI']) === FALSE) 
    {
        echo show_ad_camp_1();
    }
?>
</div>
0

精彩评论

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

关注公众号