Display latest albums

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-33607

But 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.


  • acrylian Administrator
    There is a function getAlbumStatisics which returns the pure data. Remember we most always have get/print pairs for the reason CSS is not enough.

    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.
  • Thanks acrylian

    I will try to find an example of getAlbumStatistic() in the wild, maybe I can find one in a theme.

  • acrylian Administrator
    It's really not that complicated. getAlbumStatistics returns an array of the albums fetched. You just need to look at what it returns and use it. Maybe a bit object model stuff as well (see our user guide) depending on what you want to do.

    And then there is always paid support :-)
  • I found this piece of code:

    $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 :)
  • Thanks for the info acrylian I went to the user guide, read a little about object model and I was able to do it.

    Here is the code:

    <section class="item-listing home-latest-albums"> </section>

    Full context: https://github.com/fmontes/mirumbita2014/blob/master/app/index.php
  • acrylian Administrator
    Great you managed it!
Sign In or Register to comment.