Support » Fixing WordPress » How do you add your Adsense Activation Code into the site

  • Help please, this is doing my head in 🙁
    I am using: WordPress 4.9.2 running MH FoodMagazine theme.
    I cannot for the life of me figure out how to or where to:
    Add the Adsense activation code into this theme.
    It says to:
    Paste it into the HTML, between the <head> and </head> tags
    I cannot find these tags in editor or the plugin apps header/footer has not been tried on this theme.
    Can someone please help me, I would be so grateful!
    Regards,
    Nicole.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Nicole,

    if you are open to using a plugin then I can suggest Advanced Ads. Disclaimer: I developed it.

    After you activated the plugin, just go to Advanced Ads > Settings > AdSense, type in the publisher ID (from the activation code) and enable the “Page-Level Ads” option.

    The AdSense activation code should then be added automatically at the right place.

    Thomas

    Im personally using adInserter plugin, no advertise Im NOT developer i just like this plugin as its easy to use.

    Otherwise you can add it manually anywhere you want by inserting ONE time in header:
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

    Open tools>>editor and find header.php file and add before </head>

    and add the rest of the adsense code anywhere you want like widget or template files:

    <!-- MY-SITE-ADS RESPONSIVE -->
    <ins class="adsbygoogle"
         style="display:block"
         data-ad-client="ca-pub-1111111111111111"
         data-ad-slot="111111111111111"
         data-ad-format="vertical"</ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>

    Use responsive ads to adjust to all sizes automatically.

    If you want to use specific sizes with responsive ads just add this before the code:

    <div class="ads_2">
    <style type="text/css">
    .adslot_2 { width: 120px; height: 240px; }
    @media (min-width:500px) { .adslot_2 { width: 120px; height: 600px; } }
    @media (min-width:800px) { .adslot_2 { width: 160px; height: 600px; } }
    @media (min-width:1000px) { .adslot_2 { width: 300px; height: 1050px; } }
    </style>
    --- GOOGLE ADSENSE CODE ---
    </div>
    • This reply was modified 1 year, 6 months ago by  Slllobodan.
    • This reply was modified 1 year, 6 months ago by  Slllobodan.
    • This reply was modified 1 year, 6 months ago by  Slllobodan.

    Editing theme files would be much easier with FileZilla software for win or mac instead using editor in wp. Just install https://filezilla-project.org/ and logging with:

    host: your-site-.com
    username: your-hosting-username
    password: your-hosting-password

    Find all your website files and structure in public_html, look for wp-content/themes/your-theme-name/header.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do you add your Adsense Activation Code into the site’ is closed to new replies.