Forums

aligning adsense code in single.php (4 posts)

  1. herbiehysteria
    Member
    Posted 2 years ago #

    hi guys
    i have added my google adsense code into my single.php so that the ads display after the title but before the post content, and also at the end of the post.

    i added the code in single.php just before <div="entry"> and also after the </div> end tag for "entry". the ads appear fine.

    i want to centralise the ads nd also add some padding around them

    i have tried adding
    .post_content ins {
    left: 17%;
    margin:5px 0;
    }
    to my stylesheet and this centralises the ads, but wrecks the layout in IE.

    can i wrap the two google codes in a div and css instead? would this work better? i have tried finding a few things but the alignment is still wrong.

  2. herbiehysteria
    Member
    Posted 2 years ago #

    anyone? theres enough info out there in regards to inserting the ads in single.php, but not about alignment using CSS. i am using the 234x60 single ad unit but its on the left.

    http://www.artbyherbie.com/index.php/2010/04/dell-3100cn-how-i-fixed-the-colour-streaking-problem/

  3. herbiehysteria
    Member
    Posted 2 years ago #


  4. herbiehysteria
    Member
    Posted 2 years ago #

    thanks for the over-whelming response(!)
    i sorted it by adding <center>adsense code here</center> within the template file, works a charm.

Topic Closed

This topic has been closed to new replies.

About this Topic