• I am trying to get an ad to show up only on the post’s pages, not the home page. I tried this, but it broke wordpress:

    <?php
    $str="<script type="text/javascript"><!--
    google_ad_client = "pub-8354211138613238";
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
    google_ad_type = "text_image";
    //2007-08-19: lizrevision
    google_ad_channel = "2941667369";
    google_color_border = "444422";
    google_color_bg = "F3F3F3";
    google_color_link = "666633";
    google_color_text = "666666";
    google_color_url = "666633";
    //-->
    </script>
    <script type="text/javascript"
      src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>"
    
    	$content = addslashes($str);
    	if !is_home() echo $content;?>

    It seems like it should work.. I’m confused. Help?

  • The topic ‘Show ad only on post pages (not on home page)’ is closed to new replies.