hello
i try insert adsense between 2 rows in album.php (zenpage theme), I tried the following code but it does not work
<div id="albums">
<?php $counter =0; ?>
<?php while (next_album()): ?>
<?php $counter ++;?>
<?php if(($count==2) ): ?>
<p>code adsense </p>
<?php endif; ?>
where's my mistake ?
ps: sorry for my bad english
Comments
Also check your nesting. Using endif is possible but really no one does. In the example the while loop is not closed, too.
if I put this (without php endif)
<div id="albums">
<?php $count=''; ?>
<?php while (next_album()): ?>
<?php if(($count==2) ): ?>
<p>mon code asdense </p>
<div class="album">
<div class="thumb">
" title="<?php echo gettext('View album:'); ?> <?php getBareAlbumTitle();?>"><?php printCustomAlbumThumbImage(getBareAlbumTitle(), NULL, 95, 95, 95, 95); ?>
</div>
<div class="albumdesc">
<h3>" title="<?php echo gettext('View album:'); ?> <?php echo getBareAlbumTitle();?>"><?php printAlbumTitle(); ?></h3>
<?php printAlbumDate(""); ?>
<div><?php echo shortenContent(getAlbumDesc(), 45,'...'); ?></div>
</div>
<p style="clear: both; "></p>
</div>
<?php endwhile; ?>
</div>
it gives me an error unexpected $end
`
<?php $count=''; ?>
<?php while (next_album()): ?>
<?php if($count==2) { ?>
mon code asdense
<?php } ?><?php echo gettext('View album:'); ?> <?php getBareAlbumTitle();?>"><?php printCustomAlbumThumbImage(getBareAlbumTitle(), NULL, 95, 95, 95, 95); ?>
<?php printAlbumDate(""); ?><?php echo gettext('View album:'); ?> <?php echo getBareAlbumTitle();?>"><?php printAlbumTitle(); ?>
<?php echo shortenContent(getAlbumDesc(), 45,'...'); ?>
<?php endwhile; ?>
`
thank you for your help, but your code does not work, nothing appears on my site. is that it works on yours ?
I really again like to recommend to get into PHP basics. This is fairly basic stuff and you will be rewarded the more you work on your site.
This is the working and cleaned code for the
`next_album()` loop on `gallery.php` of the Zenpage theme:
`
<?php $count = ''; ?>
<?php while (next_album()): ?>
<?php if($count==2) { ?>
mon code asdense
<?php } ?>" title="<?php echo gettext('View album:'); ?> <?php printBareAlbumTitle();?>"><?php printCustomAlbumThumbImage(getBareAlbumTitle(), NULL, 95, 95, 95, 95); ?>
" title="<?php echo gettext('View album:'); ?> <?php printBareAlbumTitle();?>"><?php printAlbumTitle(); ?>
<?php printAlbumDate(""); ?><?php $count++; ?>
<?php endwhile; ?>
`
If it does not work then something must be wrong with the implementation of the AdSense code.
thank you very much fretzel.