Thomas Rozanov Posted January 31, 2011 Report Posted January 31, 2011 I would like to put the adsense code into my header. But it's an html code. So what i have come up with now is i put it into layout.tpl and in the header line (at the top where img_15 is in obsess blue) the code originally was: <script type="text/javascript"><!-- google_ad_client = "ca-pub-############"; /* Header */ google_ad_slot = "8775993061"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> What i thought i would do is substitute: <div class="size"> <div class="header"> <div class="header01"> <div class="logo"> <img src="<?php echo SITE_URL?>/lib/skins/ObsessBlue/image/img_15.jpg" alt="" /> </div> the img src with my script. However its in html not in php so i did a little research and came up with this <script type=\"text/javascript\"><!-- google_ad_client = \"ca-pub-############\"; /* Header */ google_ad_slot = \"8775993061\"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script> What i did is is i put \ after every quotation and now i want to put that into this :<?php echo('whatever HTML'); ?> And that should work. However i tried and it didnt What did i do wrong? How do i put it into this ? <div class="size"> <div class="header"> <div class="header01"> <div class="logo"> <img src="<?php echo SITE_URL?>/lib/skins/ObsessBlue/image/img_15.jpg" alt="" /> </div> Quote
Tom Posted January 31, 2011 Report Posted January 31, 2011 Just put: <script type="text/javascript"><!-- google_ad_client = "ca-pub-############"; /* Header */ google_ad_slot = "8775993061"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> Between <head> and </head> somewhere, in layout.tpl. Simple as that. Quote
Thomas Rozanov Posted January 31, 2011 Author Report Posted January 31, 2011 Just put: <script type="text/javascript"><!-- google_ad_client = "ca-pub-############"; /* Header */ google_ad_slot = "8775993061"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> Between <head> and </head> somewhere, in layout.tpl. Simple as that. Yeah but i want it to substitute and be in the header place. Quote
Thomas Rozanov Posted January 31, 2011 Author Report Posted January 31, 2011 So how and where do i put it into this: <div class="size"> <div class="header"> <div class="header01"> <div class="logo"> <img src="<?php echo SITE_URL?>/lib/skins/ObsessBlue/image/img_15.jpg" alt="" /> </div> and do i change the div class? to what? and where does the script go? Quote
Tom Posted January 31, 2011 Report Posted January 31, 2011 <div class="size"><div class="header"> <div class="header01"> <div class="logo"> <img src="<?php echo SITE_URL?>/lib/skins/ObsessBlue/image/img_15.jpg" alt="" /> </div> What does this have to do with adsense? Either way, it's invalid; you open divs you don't close... it will break things. Quote
Thomas Rozanov Posted January 31, 2011 Author Report Posted January 31, 2011 What does this have to do with adsense? Either way, it's invalid; you open divs you don't close... it will break things. Were the img_15 is where i want to put my ad on my website. And this script is default from obsess blue skin. Or would you suggest another way of putting it into that exact spot? Please help me. What do i do to make the google adsense code to substitute the img_15 location. Please help Quote
Thomas Rozanov Posted January 31, 2011 Author Report Posted January 31, 2011 I mean i just want to put my ads banner into the spot where img_15.jpg is. And so i thought if i somehow change the script from image link to code i will just put my adsense code and it will work. Quote
Tom Posted January 31, 2011 Report Posted January 31, 2011 Right ok, that makes more sense. Replace <img src="<?php echo SITE_URL?>/lib/skins/ObsessBlue/image/img_15.jpg" alt="" /> with the code adsense gives you. Quote
Thomas Rozanov Posted January 31, 2011 Author Report Posted January 31, 2011 I mean i just want to put my ads banner into the spot where img_15.jpg is. And so i thought if i somehow change the script from image link to code i will just put my adsense code and it will work. Quote
Tom Posted January 31, 2011 Report Posted January 31, 2011 Right ok, that makes more sense. Replace <img src="<?php echo SITE_URL?>/lib/skins/ObsessBlue/image/img_15.jpg" alt="" /> with the code adsense gives you. Quote
Thomas Rozanov Posted January 31, 2011 Author Report Posted January 31, 2011 Dont I have to change the div class or anything? Because i tried it that way and it didnt work Maybe i need to put the / before each " like i did already. And could you please give me an example of how it would look please. <div class="size"> <div class="header"> <div class="header01"> <div class="logo"> <img src="<?php echo SITE_URL?>/lib/skins/ObsessBlue/image/img_15.jpg" alt="" /> </div> So i just substitute??? <div class="size"> <div class="header"> <div class="header01"> <div class="logo"> <img src=" <script type="text/javascript"><!-- google_ad_client = "ca-pub-############"; /* Header */ google_ad_slot = "8775993061"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>"" /> </div> ?????? Quote
Thomas Rozanov Posted January 31, 2011 Author Report Posted January 31, 2011 Yes. Okay i will try it now imediately. Thanks a lot ! And i'll tell you if it works or doesn't Quote
Thomas Rozanov Posted January 31, 2011 Author Report Posted January 31, 2011 Nope unfortunately doesnt work. It just doesnt show anything. This is the script i used. /* This should be the first thing you place after a <body> tag This is also required by phpVMS */ echo $page_htmlreq; ?> <div class="size"> <div class="header"> <div class="header01"> <div class="logo"> <img src="<script type="text/javascript"><!-- google_ad_client = "ca-pub-##############"; /* Header */ google_ad_slot = "8775993061"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>" /> </div> Quote
Thomas Rozanov Posted January 31, 2011 Author Report Posted January 31, 2011 Nope unfortunately doesnt work. It just doesnt show anything. This is the script i used. /* This should be the first thing you place after a <body> tag This is also required by phpVMS */ echo $page_htmlreq; ?> <div class="size"> <div class="header"> <div class="header01"> <div class="logo"> <img src="<script type="text/javascript"><!-- google_ad_client = "ca-pub-##############"; /* Header */ google_ad_slot = "8775993061"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>" /> </div> Maybe div class should be changed from logo? or i should add or edit something in the script Quote
Tom Posted January 31, 2011 Report Posted January 31, 2011 Have you actually read what Adsense tells you to do? It has nothing to do with the divs... Quote
Moderators mark1million Posted January 31, 2011 Moderators Report Posted January 31, 2011 Do you mean like on my site. http://www.easyjetva.com Quote
Thomas Rozanov Posted February 1, 2011 Author Report Posted February 1, 2011 Do you mean like on my site. http://www.easyjetva.com Yes, Exactly!!!!! Can you share how you did it please! Please . You have it were img_15 is. Can you please share how you did it please! And did you edit layout.tpl? Quote
Moderators mark1million Posted February 1, 2011 Moderators Report Posted February 1, 2011 Depends which layout you are using but basically put your adsence script code within that div container and thats it. Quote
Thomas Rozanov Posted February 1, 2011 Author Report Posted February 1, 2011 Could you please give it to me for obsess blue? (The one your using too) And i am editing layout.tpl Can you please tell me how and where to put it into this:? Instead of img_15 <div class="size"> <div class="header"> <div class="header01"> <div class="logo"> <img src="<?php echo SITE_URL?>/lib/skins/ObsessBlue/image/img_15.jpg" alt="" /> </div> I will greatly appreciate it! Thanks In Advance,. Quote
Moderators mark1million Posted February 1, 2011 Moderators Report Posted February 1, 2011 Could you please give it to me for obsess blue? (The one your using too) And i am editing layout.tpl Can you please tell me how and where to put it into this:? Instead of img_15 <div class="size"> <div class="header"> <div class="header01"> <div class="logo"> <img src="<?php echo SITE_URL?>/lib/skins/ObsessBlue/image/img_15.jpg" alt="" /> </div> I will greatly appreciate it! Thanks In Advance,. Just place your code between that logo class div <div class="logo"> place your code here </div> Quote
Thomas Rozanov Posted February 1, 2011 Author Report Posted February 1, 2011 Thanks Everyone! For Helping me! I am very thankful and really appreciate it. Thank You! It works succesfully. Mark Million I owe you help. Quote
Moderators mark1million Posted February 1, 2011 Moderators Report Posted February 1, 2011 No problem, glad to help. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.