[SOLVED] Help with inserting Adsense banner between album items
mcemrn
Joined: 2013-02-17
Posts: 20 |
![]() |
|||
Hi everybody, i need help inserting an Adsense banner ( Banner 468 x 60 ) between the items of the album, precisely after three items, please see the screenshot attached. I think i have to modify the file \themes\wind\views\album.html.php I hope someone can help me, Michele
|
||||
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
|||
This could be converted to a module but this should work for now. Add: <script> $(document).ready(function() { $('#g-advert-code').insertAfter('#g-album-grid li:nth-child(3)'); }); </script> <li id="g-advert-code"><div>advert code goes here</div></li> to the bottom of \themes\<your theme>\views\album.html.php Dave |
||||
mcemrn
Joined: 2013-02-17
Posts: 20 |
![]() |
|||
floridave wrote:
This could be converted to a module but this should work for now. Add:<script> $(document).ready(function() { $('#g-advert-code').insertAfter('#g-album-grid li:nth-child(3)'); }); </script> <li id="g-advert-code"><div>advert code goes here</div></li> Oh Thanks floridave! You are fantastic, thanks for the code! Please help EDIT: I tested some browsers... WON'T WORK ON: Google Chrome, Internet Explorer 9, Opera, Safari |
||||
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
|||
Quote:
WON'T WORK ON: Google Chrome, Internet Explorer 9, Opera, Safari Works for me in Chrome and IE10 and Safari 5.17 windows. Does standard text and html work in the <div>advert code goes here</div> without the goofy js and iframe stuff from your advert banner? Dave |
||||
mcemrn
Joined: 2013-02-17
Posts: 20 |
![]() |
|||
floridave wrote:
Ok the standard example text "advert code goes here" work good and display properly in all the browsers i tested like Chrome, Firefox, IE 8,9,10, Opera and Safari. But when i put my Adsense Banner 468x60 between the tags <div></div> the banner will show (in browsers Chrome, IE 9, Opera, Safari) only the first page, then when i surf the gallery and change album the banner won't show anymore and only a blank div is showed unless i click F5 button. |
||||
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
|||
I tried a few things with jquery and iframes......some luck with iframes but the TOS get in the way. <? if($i==3) { ?> <li>google advert code here</li> <? } ?> Dave _____________________________________________ |
||||
mcemrn
Joined: 2013-02-17
Posts: 20 |
![]() |
|||
floridave wrote:
I tried a few things with jquery and iframes......some luck with iframes but the TOS get in the way. Thanks, now the code works 100% on every browser! Thanks for the time! Thanks, Thanks, Thanks |
||||