Code to Run Specific Ads on Specific Posts
-
I’ve been asked to change the ad code that runs only on three specific posts — on the other posts the regular ads will run. I tried to piece together some PHP code for it and came up with this:
<?php if( ($post->ID == 43751) || ($post->ID == 43647) || ($post->ID == 43611)) { ?> <iframe id="Adv1" src="https://ad.doubleclick.net/adi/real.filmcom/evilbeetgossip;pageurl=/evilbeetgossip;cat=tvondvd;subcat=;contentid=;dcopt=ist;sz=728x90;ord=14456755;tile=1" width="728" height="90" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"> </iframe> <?php } ?> <?php else { ?> <iframe id="Adv1" src="https://ad.doubleclick.net/adi/real.filmcom/evilbeetgossip;pageurl=/evilbeetgossip;cat=celebrities;subcat=;contentid=;dcopt=ist;sz=728x90;ord=14456755;tile=1" width="728" height="90" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"> </iframe> <?php } ?>
Unfortunately when I put this code in header.php the site doesn’t load. I’m sure there’s some parsing problem but I don’t have enough knowledge of PHP to figure out what it is. Help?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Code to Run Specific Ads on Specific Posts’ is closed to new replies.