How to Add a Banner Ad
I would like to add a 720×90 banner ad to my blog, but I’m not sure where to enter the ad code.
I would like to place the ad between my blog header and the nav bar. I’m assuming I would place the ad code in the header.php, but I have no clue as to where within the header.php.
Any guidance as to where I should place this piece of code is greatly appreciated!
My blog: http://www.BrownBombshellBeauty.com
Ok, so I almost figured this out on my own, with two exceptions:
1. I placed the ad code at the very bottom of the header.php. Now the ad is below the nav bar, as opposed to above the nav bar, where I want it to be.
2. I successfully centered the add, but now every single text, on every single page on the site is centered. I have NO clue how to center the banner ad without centering my whole blog.
Again, I really appreciate the time and expertise of those who answer questions on this forum!
you could try and add your code just before this line in header.php:
<div id="navbar" class="clearfloat">
btw: the closing tag needs to be
if that does not work, you could paste the code of header.php into a http://wordpress.pastebin.com/ and post the link to it here; for someone to look at?
Thanks so much for your help! It worked beautifully, except for when you get to the second page. On page 2 the add is surrounded by a grey box, and the blog itself it totally out of whack.
What should I do to fix this, as it’s looking pretty bad. Here’s a link to what’s going on:
Thanks for your help!
i suggested: before
however, the ads placement has nothing to do with the display of the ‘page 2’ – this is also there on page 1, and seems to be caused by the erranaous closing div
</div>here in the code (probably of index.php):
<div id="page" class="clearfloat"> </div>
(which, btw, is only one of the many validation errors
which might cause any unrelated display problems in any browser)
I realized my mistake, and placed the ad code in the correct place.
As far as the closing div, I’m not really too familiar. Should I delete the </div> you mentioned?
I checked the site you linked to. I had no idea there were so many errors on my site! How do I go about making these changes without screwing up my blog?
Again, thanks for your help!
well done, seems to be working 😉
i haven’t looked closely at the list of validation errors – however, the ususal way is to start at the top and try to identify in which template file the code is which causes the error – then try to fix it – and don’t change anything if you are not sure how to do it right
( http://www.w3schools.com/html/default.asp for instance is a source to check for the right code )
often errors further down in the list will automatically disappear if top errors are fixed.
some errors might be from plugins, where you only have little influence without deep knowledge of programming; other errors might be from the content of the posts as well.
re-run the validator inbetween.
- The topic ‘How to Add a Banner Ad’ is closed to new replies.