ZenphotoCMS Forum
Insert Adsense between albums in version 1.4.13 - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Insert Adsense between albums in version 1.4.13 (/thread-12582.html)



Insert Adsense between albums in version 1.4.13 - mcemrn - 2016-09-15

Hello, i am new to this forum and i am trying to insert Adsense code between albums.

I found this old thread: http://www.zenphoto.org/support/topic.php?id=32466 but it is three years old.

Can you help me please to adapt fretzl Member Staff Forum old code to new version 1.4.13 ?

In album.php file the unmodified code is:

`

">

">

`




Insert Adsense between albums in version 1.4.13 - fretzl - 2016-09-15

Correct me if I'm wrong but I believe you tried to add code from album.php from the basic theme? So I edited it. Code should always be between "backticks" (`)




Insert Adsense between albums in version 1.4.13 - mcemrn - 2016-09-15

Hello fretzl, yes, i am trying to add code in album.php from the basic theme, thanks for editing it with backticks




Insert Adsense between albums in version 1.4.13 - fretzl - 2016-09-15

The code from the old post should still work...BUT you will have to change getAlbumLinkURL() to getAlbumURL()




Insert Adsense between albums in version 1.4.13 - fretzl - 2016-09-15

Just noticed that the code from the old post is specifically for the Zenpage theme.(thumbs are generated a bit different)

Here's the code that should work for the basic theme:
`

your Adsense code here

">

">

`




Insert Adsense between albums in version 1.4.13 - mcemrn - 2016-09-15

Thanks fretzl ! It works ! I added it to index.php so i can not put Adsense between albums.

I want to add Adsense code too between images thumbails in album.php
If i am not wrong code to modify is:
`

">

`
Can i ask this code too ? Please i would be very grateful




Insert Adsense between albums in version 1.4.13 - acrylian - 2016-09-15

Within the next_image loop it would be the same acually. But of course everything you put in the to loop will be looped, too. So you would get as many adsense ads as there images or albums.

That would be a lot of ads that surely will not keep visitors to your site. You probably want one place of ads on the page. So you probably want to add it outsde the both loops instead? OR as the old code suggest limit the display by checking the loop count.




Insert Adsense between albums in version 1.4.13 - fretzl - 2016-09-15

`

your Adsense code here

">

Depending on where (i.e. after which thumbnail) you want the Adsense code to appear you will probably have to change the number inif($count==2)`




Insert Adsense between albums in version 1.4.13 - mcemrn - 2016-09-15

Thank you fretzl ! Yes, also this code works for me and yes i chosen loop count.

This request can be marked as Solved, thank you very much for the support