MyBB Community Forums
How To Add Your Adsense Code To Header & Footer (No Plugins) [1.6 & 1.4] - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: Tutorials (https://community.mybb.com/forum-38.html)
+--- Thread: How To Add Your Adsense Code To Header & Footer (No Plugins) [1.6 & 1.4] (/thread-77694.html)

Pages: 1 2


How To Add Your Adsense Code To Header & Footer (No Plugins) [1.6 & 1.4] - Kaleb M - 2010-09-05

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>



RE: How To Add Your Adsense Code To Header (No Plugins) [1.6 & 1.4] - Alan S. - 2010-09-05

<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


RE: How To Add Your Adsense Code To Header (No Plugins) [1.6 & 1.4] - Kaleb M - 2010-09-05

(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.


RE: How To Add Your Adsense Code To Header & Footer (No Plugins) [1.6 & 1.4] - neoinwild - 2010-09-15

how do I put my google adsense advert just next to logo? - am using mybb 1.6


RE: How To Add Your Adsense Code To Header & Footer (No Plugins) [1.6 & 1.4] - Alan S. - 2010-09-15

(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>



RE: How To Add Your Adsense Code To Header & Footer (No Plugins) [1.6 & 1.4] - adbrad - 2010-09-15

(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




RE: How To Add Your Adsense Code To Header & Footer (No Plugins) [1.6 & 1.4] - Alan S. - 2010-09-15

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

Fixed.


RE: How To Add Your Adsense Code To Header & Footer (No Plugins) [1.6 & 1.4] - jkry2121 - 2011-08-16

mega bump (sorry) is there anyway to make ads group specific? like i dont want vips to have to see ads...


RE: How To Add Your Adsense Code To Header & Footer (No Plugins) [1.6 & 1.4] - Gunner10 - 2011-09-08

<div style="text-align: center; margin: 30px 0;">

*AdSense Code

</div>

Margin is necessary (AdSense Policy)

Sorry for mi bad english.


RE: How To Add Your Adsense Code To Header & Footer (No Plugins) [1.6 & 1.4] - crazy4cs - 2011-09-09

(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.