• Resolved flamey

    (@flamey)


    WP 3.9.1
    NextGEN 2.0.65

    How do I find out any info (or specifically PID) from within a template?

    I followed example on how to create custom template, creating it in /themes/<theme>/nggallery/gallery-templatename.php , it picks it up. But I need to find out which image is the preview image for the gallery.

    [“previewpic”]=>int(0) for all images in the collection, even the one which is selected for preview.

    https://wordpress.org/plugins/nextgen-gallery/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter flamey

    (@flamey)

    never mind, i found the solution.

    $previewPicId = $gallery->displayed_gallery->get_galleries()[0]->previewpic;
    $previewPicUrl = '';
    foreach ( $images as $image ) {
        if ($image->pid == $previewPicId) {
            $previewPicUrl = $image->imageURL;
            break;
        }
    }

    Plugin Contributor photocrati

    (@photocrati)

    @flamey – Well Done! … and thanks for sharing your findings, too!

    – Cais.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Preview picture's PID from template’ is closed to new replies.