WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Advanced Custom Fields - NextGEN Gallery Field add-on

Adds a NextGEN Gallery Field to Advanced Custom Fields. Select one or more NextGEN Galleries and assign them to the post.

This is an add-on for the Advanced Custom Fields WordPress plugin and will not provide any functionality to WordPress unless advanced Custom Fields is installed and activated.

The NextGEN Gallery field provides a dropdown (select or multi-select) of NextGEN Gallery names (galleries and albums) and the ability to map the selected NextGEN Gallery to the post. The get_value() API returns an array of the selected NextGEN Gallery IDs and the form – album or gallery.

This script works supports both ACF version 3- and ACF version 4+.

!!! Version 1.1 change get_value() API returned value. You must change your template files. !!!

The get_value() API returns a following array:

Array (
    [0] => Array (
        [ngg_id] => 8  ( NextGEN Gallery 'gallery' or 'album' ID )
        [ngg_form] => gallery  ( 'gallery' or 'album' )
    )
)

Example

These examples should show a NextGEN Gallery gallery or NextGEN Gallery album.

For version 1.1 and later

<?php
    foreach ( get_field ( 'nextgen_gallery_id' ) as $nextgen_gallery_id ) :
        if ( $nextgen_gallery_id['ngg_form'] == 'album' ) {
            echo nggShowAlbum( $nextgen_gallery_id['ngg_id'] ); //NextGEN Gallery album
        } elseif ( $nextgen_gallery_id['ngg_form'] == 'gallery' ) {
             echo nggShowGallery( $nextgen_gallery_id['ngg_id'] ); //NextGEN Gallery gallery
        }
    endforeach;
?>

For version 1.0.2 and earlier

<?php
    foreach (get_field ('portfolio_nextgen_gallery_id') as $nextgen_gallery_id) :
        echo nggShowGallery( $nextgen_gallery_id );
    endforeach;
?>

Requires: 3.0 or higher
Compatible up to: 3.5.2
Last Updated: 2013-10-23
Downloads: 14,699

Ratings

2 stars
2.8 out of 5 stars

Support

0 of 1 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,2,2
50,2,1 100,1,1 100,1,1
0,2,0
0,1,0