Title: aligning adsense code in single.php
Last modified: August 19, 2016

---

# aligning adsense code in single.php

 *  [Johnny Bravo](https://wordpress.org/support/users/herbiehysteria/)
 * (@herbiehysteria)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/aligning-adsense-code-in-singlephp/)
 * 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.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Johnny Bravo](https://wordpress.org/support/users/herbiehysteria/)
 * (@herbiehysteria)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/aligning-adsense-code-in-singlephp/#post-1471276)
 * 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 234×60 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/](http://www.artbyherbie.com/index.php/2010/04/dell-3100cn-how-i-fixed-the-colour-streaking-problem/)
 *  Thread Starter [Johnny Bravo](https://wordpress.org/support/users/herbiehysteria/)
 * (@herbiehysteria)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/aligning-adsense-code-in-singlephp/#post-1471298)
 *  Thread Starter [Johnny Bravo](https://wordpress.org/support/users/herbiehysteria/)
 * (@herbiehysteria)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/aligning-adsense-code-in-singlephp/#post-1471299)
 * thanks for the over-whelming response(!)
    i sorted it by adding <center>adsense
   code here</center> within the template file, works a charm.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘aligning adsense code in single.php’ is closed to new replies.

## Tags

 * [single.php](https://wordpress.org/support/topic-tag/single-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 1 participant
 * Last reply from: [Johnny Bravo](https://wordpress.org/support/users/herbiehysteria/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/aligning-adsense-code-in-singlephp/#post-1471299)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
