Site logo

Archived topic

Adsense code with hooks

6 replies · Started by Charalambos on July 5, 2018

Viewing posts 1–7 of 7

Hello,

I have placed an ad code with gp hooks just below the title (After entry title). The ad appears ok in mobile version, however as you can see in the screenshot there is too little spacing between the title and the ad in the desktop version and as a result it covers part of the title letters.

https://imgur.com/a/OYZLESP

My question is how can i move the ad a bit down? I currently use the code below to center the add and show only in single posts.

<?php if ( is_single() ) : ?>

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Content Ad -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="xx-xxx-xxxxxxxxxxxx"
data-ad-slot="xxxxxxxxxxx"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

<?php endif; ?>

thanks in advance

Charalambos

thats the code i use below,

<?php if ( is_single() ) : ?>

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Content Ad -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="xx-xxx-xxxxxxxxxxxx"
data-ad-slot="xxxxxxxxxxx"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

<?php endif; ?>

Hello,

Thanks for your reply. So shall i add this css code in the hooks below the adsense code?

Also just to clarify all the other ads look good. I only want to fix the ad below the post title.

thanks

Charalambos

Hello,

Thanks again, it works!

No problem :)

This archived topic is closed to new replies.