Hey guys,
Im working in a custom theme and I need to display X numbers of the latests albums in the homepage.
Right now I'm using printLatestAlbums() and is working as expected but I need a very specific HTML markup.
So I was trying to write my own php function for the theme using this as base:
http://www.zenphoto.org/support/topic.php?id=5783#post-33607But I wasn't able too do it... my PHP knowledge is not so good.
Any change anybody have something I can use?
Thanks in advance.
Comments
So either you use printLatestAlbums() renamed with your customisations or you make your entire own custom function (both either via the theme's functions.php or another plugin). Sorry but without PHP knowledge you will not get far with these things.
I will try to find an example of getAlbumStatistic() in the wild, maybe I can find one in a theme.
Regards...
And then there is always paid support :-)
<?php
$latestalbums = array(getAlbumStatistic(20, "latest"));
foreach ($latestalbums as $latestalbum) {
printAlbumStatistic(20, "latest", $latestalbum['title']);
}
?>
And I think I can make it work. If not... paid support will be
Here is the code:
<section class="item-listing home-latest-albums">
<?php } ?>
</section><?php
// http://www.zenphoto.org/documentation/classes/ThemeObject.html
$latestalbums = getAlbumStatistic(getOption("latest_albums_number_home"), "latest-date", "", "desc");
foreach ($latestalbums as $latestalbum) {
$album = newAlbum($latestalbum[folder]);
?>
<article>
getAlbumLink() ?>" class="album-thumb">
<img src="<?php echo $album->getAlbumThumb(); ?>" alt="<?php echo $album->getTitle() ?>">
<div class="album-info">
<h3 class="album-title">
getAlbumLink() ?>">
<?php echo $album->getTitle() ?>
</h3>
<?php $date = date_create($album->getDateTime()); ?>
<time datetime="<?php echo date_format($date, 'Y-m-d'); ?>" class="album-date"><?php echo date_format($date, 'd/m/y'); ?></time>
<div class="fb-like" data-href="http://<?php echo getMainSiteURL() ?><?php echo $album->getAlbumLink() ?>" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></div>
</div>
</article>
Full context: https://github.com/fmontes/mirumbita2014/blob/master/app/index.php