• Resolved thedoghouse.jp

    (@thedoghousejp)


    Hi,

    I need help placing my adsense ads…

    Here’s my website: https://www.thedoghouse.jp/

    I want to place the ad between the menu bar and the title (“Welcome to THE DOGHOUSE,” etc.) on all of the pages.

    What do I need to do? I tried the plugin, but it places them where I don’t want them, and the spot I’m trying to get it in isn’t an option.

    Thanks in advance!

    Kuma

Viewing 9 replies - 1 through 9 (of 9 total)
  • try editing header.php in the child theme (copy the full code from header.php of Twenty Thirteen), and place the adsense code before:

    <div id="main" class="site-main">
    Thread Starter thedoghouse.jp

    (@thedoghousejp)

    when you say “copy” do i paste it in custom css or something or just edit header.php?

    Thread Starter thedoghouse.jp

    (@thedoghousejp)

    i just edited header.php, but i’d like to shift the ad to the right and move the content below up closer to the ad. Maybe some spacing between the menu bar and the ad too. Thanks a lot for your help!

    right now, I don’t see any adsense code in the site;

    generally, if you need to be able to position the ads, try wrapping the code into a div and use CSS;

    example for the code to be added into header.php in the child theme:

    <div class="sub-header-ad">
    ADSENSE CODE HERE
    </div>

    in the custom CSS, add for example:

    .sub-header-ad { display: block; margin: auto; }
    Thread Starter thedoghouse.jp

    (@thedoghousejp)

    thanks again, but that didn’t work… if you go to my site again, you’ll see what i mean.

    Thread Starter thedoghouse.jp

    (@thedoghousejp)

    i think i kind of got it (the ad wasn’t showing for me, but i think that’s because i just created it, and it takes some time?) i would like the ad lined up to the logo though if possible…

    here’s what i did…

    1. i added the following at the bottom of header.php:

    <br>
    <div id="sub-header-ad" class="sub-header-ad">
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- tdh_ad -->
    <ins class="adsbygoogle"
         style="display:block"
         data-ad-client="ca-pub-6898645363314795"
         data-ad-slot="5382192662"
         data-ad-format="auto"></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    </div>

    2. i added the following in the custom css:

    .sub-header-ad {
    margin: 0 auto;
    max-width: 700px;
    width: 100%;
    }

    i still want the content moved up closer to the ad… i think there’s too much space in between. any help i could get would be greatly appreciated!

    the ad is there and it is centered horizontally.

    you might need to clear your browser cache to see the latest changes – CTRL F5 or ‘reload’ …

    to move the content closer, add to the custom CSS:

    .hentry { padding-top: 0; }

    or specifically for the front page:

    .home .hentry { padding-top: 0; }
    Thread Starter thedoghouse.jp

    (@thedoghousejp)

    Thank you so much for all your help alchymyth!

    Thread Starter thedoghouse.jp

    (@thedoghousejp)

    Resolved!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Adsense Help’ is closed to new replies.