• Resolved Donquiweb

    (@donquiweb)


    Hi,

    I would like to show the latest picture of an album or a gallery.
    It could be with a short code but I don’t think that I can so that with short code like [singlepic recent max=1].

    Is there a hack or any existing php code to do this?

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter Donquiweb

    (@donquiweb)

    ok, I found how to do it:

    [recent max=”1″ template=”homepage” id=”4″ mode=”date” /]

    recent max=”1″ -> show 1 picture
    template=”homepage” -> I create a new template (see below)
    id=”4″ -> ID of gallery
    mode=”date” -> to show the latest by date in the gallery id=4

    template :

    <?php
    /**
    Template Page for the gallery home page
    **/
    ?>
    <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?>
    <img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $current->url; ?>" />
    <?php endif; ?>
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: NextGEN Gallery] How to show the latest picture of an album or a gallery’ is closed to new replies.