MyBB Community Forums

Full Version: How To Add Your Adsense Code To Header & Footer (No Plugins) [1.6 & 1.4]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Admin CP > Templates > Current Theme > Header > Header > Full Edit

Go to the very bottom type "<div style="text-align: center;">" paste your ad code, then enter "</div>" at the end.

This is mainly for an image ad below your forum.

The downside of this is that ALL users see advertisements regardless of there usergroup. If you know enough you should be able to change that.

To add to your footer copy that whole code from the header, including the center, then open up your footer template. At the VERY top paste it.

Thanks to AJS
(2010-09-05, 05:03 PM)AJS Wrote: [ -> ]<center> tags are deprecated. You should really use:

<div style="text-align: center;">

You can make the ads viewable only to guests by adding the code to the header_welcomblock_guest template instead. Smile

If you used AJS's method make sure you add a </div>
<center> tags are deprecated. You should really use:

<div style="text-align: center;">

You can make the ads viewable only to guests by adding the code to the header_welcomeblock_guest template instead. Smile
(2010-09-05, 05:03 PM)AJS Wrote: [ -> ]<center> tags are deprecated. You should really use:

<div style="text-align: center;">

You can make the ads viewable only to guests by adding the code to the header_welcomeblock_guest template instead. Smile

Thanks! Will add to post.
how do I put my google adsense advert just next to logo? - am using mybb 1.6
(2010-09-15, 12:34 PM)neoinwild Wrote: [ -> ]how do I put my google adsense advert just next to logo? - am using mybb 1.6

It depends, can you provide a screenshot of what you want to achieve, or try adding this before the logo div:

<div style="float: right;">
*Adsense Code*
</div>
(2010-09-05, 04:58 PM)Kaleb M Wrote: [ -> ]Go to the very bottom type "<div style="text-align: center;">" paste your ad code, then enter "</center>" at the end.

shouldn't that be a </div> at the end

(2010-09-15, 01:09 PM)adbrad Wrote: [ -> ]shouldn't that be a </div> at the end

Fixed.
mega bump (sorry) is there anyway to make ads group specific? like i dont want vips to have to see ads...
<div style="text-align: center; margin: 30px 0;">

*AdSense Code

</div>

Margin is necessary (AdSense Policy)

Sorry for mi bad english.
(2011-08-16, 01:30 AM)jkry2121 Wrote: [ -> ]mega bump (sorry) is there anyway to make ads group specific? like i dont want vips to have to see ads...
You can use PHP in template conditional plugin by Zingaburga and add the exception like,

<if $mybb->user['usergroup'] != "8" then>
Your code here.
</if>

Where != stands for not equal to so it'd show ads to everyone other than the specified group above.

Pages: 1 2