Could you explain what has stopped working? Are the ads not displaying at all? Is the ad not aligning correctly? Could you provide a link to your site where it isn’t working correctly, and explain what part isn’t correct?
The code you provided, is that a direct copy from one of your posts? If so, the <!--
and -->
are probably causing the ad to stop displaying.
My original suggestion, which should still work, was to put the <div>
with the styles around the ad code on the plugin’s setting screen. That way you could still just use [AdSense-A] (or B or C) in your post without having to worry about formats.
For example, in Settings > AdSense In-Post, you could put your ad code in one of the boxes like this:
<div style="float: left; margin:10px;">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:inline-block;width:336px;height:280px"
data-ad-client="ca-pub-1234567812345678"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
In your blog posts you would just use the shortcode without the need for adding a <div>
around it each time. If you ever need to edit the <div>
style, you would only have to make the change once in the plugin’s settings.
You might also want to pay attention to any styles provided by the ad itself. See in the example above the style line in the ad code includes display:inline-block;
. In your example it looks like you are trying to use display:block;
. There may be a conflict with the styles used there as well.