Jump to content
Sign in to follow this  
chrisyates

Centering Adsense Ad in 'Accordian Sidebar'?

Recommended Posts

chrisyates

I was wondering if it's possible to center a Google Adsense ad in the accordian sidebar. I have attached an image to show that the current ad sits too far to the left. Any ideas are much appreciated...thanks adsense.jpg

Share this post


Link to post
Share on other sites
Andrew

sure a live link helps so we can inspect with firebug and tell you what to add. a `text-align:center` rule might do it :)

Share this post


Link to post
Share on other sites
chrisyates

The live version is here: iPad Site I was under the impression that all the sidebars would automatically center any widgets I added. I'm using the AdsenseOptimizer plugin which I just drag to the 'Accordian Sidebar' to display the ad and have no idea which PHP file it ends up in. The only way I can check is to load the page in my browser and then view the source code. Although that doesn't help much as there's no html for me to muck about with, only PHP files.

Share this post


Link to post
Share on other sites
cmunns

Did you get this figured out, it looks to be centered on your site now or at least not nearly as bad as the screenshot you provided.

Share this post


Link to post
Share on other sites
chrisyates

Hey Adam, No I haven't fully figured it out but I did use Firebug and have attached a screenshot. If I add a 'center' tag within the html it centers perfectly as you can see from the screenshot but when doing this in Firebug it's obviously not a live update. As I can't access the html file I'm presuming I need to add a 'center' rule in the css editor but can't find where I would need to do it or whether it would work. I can see the css in Firebug but it makes no sense when I go to the WP css editor. It looks like I should be editing the defaultaccordian.php file but am struggling! Any advice? centertag.jpg You can view the full screenshot here: Full Size Screenshot

Share this post


Link to post
Share on other sites
Andrew

the `align="center` won't do the trick... try adding: `style="text-align: center"`

Share this post


Link to post
Share on other sites
chrisyates

The thing is the `align="center"` did do the trick as you can see from the above image which I did within Firebug but as I said that's not a 'live' update. The point is I still don't know where to add it in the real files to make the image centered.

Share this post


Link to post
Share on other sites
cmunns

You can do this with css Try adding this to your custom css area in the theme options: ` #accordion .drawer-content { margin:0 auto; width:274px; } ` NOTE: this will center all your widgets, but let me know how that will effect your site.

Share this post


Link to post
Share on other sites
chrisyates

Tried this in the custom.css but it didn't make the slightest bit of difference. All the widgets looked the same.

Share this post


Link to post
Share on other sites
cmunns

really? It should work. Try adding it to the very bottom of your style.css then.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×