• Resolved midlife mama

    (@midlife-mama)


    Working on my child theme for Twenty Twelve and with the help of this forum figured out how to add Adsense to single post page. I learn to add code to content.php

    <?php if ( is_single() ) : ?>
    		ADSENSE CODE
    <?php endif; ?>

    The ad appears on single post page–great, and is right below the blog title–great. But the text doesn’t wrap around it. I’ve tried playing around with the style.css but since I’m still very much learning, I haven’t had much luck.

    I’d like to float it to the left with 10px padding on the right and below.

    Can someone help?

Viewing 3 replies - 1 through 3 (of 3 total)
  • for instance, wrap the adsense code into a div with the css class .adsense or so, or with inline styles;

    example:

    <?php if ( is_single() ) : ?>
    <div class="adsense">
    		ADSENSE CODE
    </div>
    <?php endif; ?>

    you can then style this in style.css; example:

    .adsense { float: left; margin-right: 10px; }

    Thread Starter midlife mama

    (@midlife-mama)

    You are a Super Star! Thank you. It worked.

    Just a quick aside for others who may read this: I first added the code to the style.css towards the end and it didn’t work. Just for fun, I moved the code toward the beginning of the style sheet, and VIOLA, it worked. So I’m learning that it’s not just code, it’s proper placement too.

    That really worked for me. Could you please tell me how to wrap the adsense code to left or right below post title…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do you wrap text around Adsense ad?’ is closed to new replies.