Comment on How to Add AdSense to WordPress by SEO Dave.

Add AdSense to a WordPress BlogIn Stallion 8.0 not only are the default Stallion AdSense ads mobile responsive, but you can use the new AdSense Responsive Ad Unit Beta code.

In Stallion 8.0 each AdSense ad unit (there’s 7 of them: 4 content ad units and 3 link ad units) has it’s own settings including size, type and individual colour options (individual colour options new to Stallion 8.0).

There’s also an override box for each ad unit (so 7 of them) where you can paste entire AdSense ad units (created under your Google AdSense Account) OR another ad system (in theory you could add any code or content) that will replace the Stallion AdSense ad unit.

Since in Stallion 8 the default AdSense ads are mobile responsive, it would be a feature downgrade to add a standard AdSense ad unit (created under your Google AdSense account) since they aren’t mobile responsive. For example the Stallion main content ad unit (the one that floats in the main content) changes to a 250x250px ad unit for mobile devices with a screen width between 240px and 320px and for smaller screen sizes to a 180x150px ad unit, doesn’t matter what you set that ad to in the AdSense settings it changes size to match the screen width. You would loose this mobile responsive feature if you added a standard content ad unit from your AdSense account.

However, Google AdSense has released AdSense Responsive Ad Unit Beta which includes mobile responsive code which will work with Stallion 8.0 The new AdSense Responsive Ad Unit Beta code looks like this (this was the default code AdSense created):

<style>
.responsive { width: 320px; height: 50px; }
@media(min-width: 500px) { .responsive { width: 468px; height: 60px; } }
@media(min-width: 800px) { .responsive { width: 728px; height: 90px; } }
</style>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Responsive -->
<ins class="adsbygoogle responsive"
     style="display:inline-block"
     data-ad-client="ca-pub-8325072546567078"
     data-ad-slot="1153997214"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

What this responsive AdSense code does is for screen sizes
Above 800px sets a 728x90px ad unit,
Between 500px and 799px sets a 468x60px ad unit,
and sets a 320x250px ad unit for all other sizes (anything below 499px).

These sizes won’t match many themes as is, but by changing

{ width: 320px; height: 50px; }
@media(min-width: 500px) { .responsive { width: 468px; height: 60px; } }
@media(min-width: 800px) { .responsive { width: 728px; height: 90px; } }

You can match various ad units to whatever mobile screen sizes you like, for example this one would match the Stallion 8.0 default Main Content Ad Unit.

<style>
.responsive { width: 180px; height: 150px; }
@media(min-width: 240px) { .responsive { width: 250px; height: 250px; } }
@media(min-width: 320px) { .responsive { width: 300px; height: 250px; } }
@media(min-width: 800px) { .responsive { width: 336px; height: 280px; } }
</style>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Responsive -->
<ins class="adsbygoogle responsive"
     style="display:inline-block"
     data-ad-client="ca-pub-8325072546567078"
     data-ad-slot="1153997214"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Why bother I hear you sigh?

Well the new AdSense Responsive Ad Unit Beta code is asynchronous ad code which is supposed to result in better web performance. Basically it will load faster and since Google search engine rankings have a speed element anything you can do to increase site speed is a positive SEO signal.

After I release Stallion 8.0 I’ll release the relevant AdSense Responsive Ad Unit Beta alternative codes to the Stallion defaults, so you can either stick with the easy to setup defaults (add your pub-NUMBER once and you are done) or create and edit up to 7 AdSense Responsive Ad Unit Beta ads (that would be fun for the 130odd domains I own!!!!).

David