WordPress.org

Ready to get started?Download WordPress

Forums

Adsense link unit below header (5 posts)

  1. jukooz
    Member
    Posted 3 years ago #

    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?

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Yes it's possible using the is_page conditional.

  3. jukooz
    Member
    Posted 3 years ago #

    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>
    }
  4. esmi
    Forum Moderator
    Posted 3 years ago #

    <?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
    }?>
  5. jukooz
    Member
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic