WordPress.org

Support

Support » How-To and Troubleshooting » Adsense link unit below header

Adsense link unit below header

  • Hello,

    I’m using Coraline theme at the moment but looking for rather universal advice.

    I want to put Adsense link unit directly below the header so it will look like menu. But what is more, I want to have it on some pages, and not have it on others (I’m using only pages).

    Is it possible?

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    @esmi

    Forum Moderator

    Yes it’s possible using the is_page conditional.

    Thank You very much.

    (I am not programmer) So I should use this method wrapped in:

    if ( is_page('about')) {
    }

    <div> tags should be inside or outside if function?

    Is code pasted below ok?

    if ( is_page('about')) {
      <div style="padding:3px;background-color:#2D6E89">
      <script type="text/javascript"><!–
      google_ad_client = "pub-7773800616131770";
      /* dijexi-link-top */
      google_ad_slot = "9510052288";
      google_ad_width = 728;
      google_ad_height = 15;
      //–>
      </script>
      <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
      </script>
      </div>
    }

    esmi

    @esmi

    Forum Moderator

    <?php if ( is_page('about')) {?>
      <div style="padding:3px;background-color:#2D6E89">
      <script type="text/javascript"><!–
      google_ad_client = "pub-7773800616131770";
      /* dijexi-link-top */
      google_ad_slot = "9510052288";
      google_ad_width = 728;
      google_ad_height = 15;
      //–>
      </script>
      <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
      </script>
      </div><?php
    }?>

    Thank You, works perfectly.

    Maybe You know why my “adsense menu” is separated from header image? I would like it to “touch” header image like ine the tutorial. I suspect it is sth in the theme code.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adsense link unit below header’ is closed to new replies.
Skip to toolbar