Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • So I made a work around solution that uses shortcodes that might help.

    Basically use the ACF NextGen Gallery Field to find the gallery ID then pass that into a shortcode that has the Plus display styles you want and then echo out the the short code using the do_shortcode() function.

    The parameter options for display type are:
    display_type=”photocrati-nextgen_basic_slideshow”
    display_type=”photocrati-nextgen_basic_thumbnails”
    display_type=”photocrati-nextgen_basic_imagebrowser”
    display_type=”photocrati-nextgen_basic_singlepic”
    display_type=”photocrati-nextgen_basic_extended_album”
    display_type=”photocrati-nextgen_basic_compact_album”
    display_type=”photocrati-nextgen_pro_slideshow”
    display_type=”photocrati-nextgen_pro_thumbnail_grid”
    display_type=”photocrati-nextgen_pro_horizontal_filmstrip”
    display_type=”photocrati-nextgen_pro_film”
    display_type=”photocrati-nextgen_pro_blog_gallery”
    display_type=”photocrati-nextgen_pro_list_album”
    display_type=”photocrati-nextgen_pro_grid_album”
    display_type=”photocrati-nextgen_pro_masonry”

    Example:

    <?php
    
        foreach ( get_field ( 'gallery' ) as $nextgen_gallery_id ) :
    $galleryID = $nextgen_gallery_id['ngg_id'];
                 $galleryShortcode = '[ngg_images gallery_ids="' . $galleryID . '" display_type="photocrati-nextgen_pro_masonry" override_thumbnail_settings="1"
     size="390" images_per_page="20" spacing="10"]';
                 echo do_shortcode($galleryShortcode);
    
        endforeach;
    ?>

    note “gallery” will need to be the name you gave the field in ACF

    I found a work around. When you are outputting the foreach in the example instead of:
    echo nggShowGallery( $nextgen_gallery_id['ngg_id']); //NextGEN Gallery gallery

    replace this with a shortcode for the gallery style you need and then run do_shortcode:

    $galleryID = $nextgen_gallery_id['ngg_id'];
                 $galleryShortcode = '[ngg_images gallery_ids="' . $galleryID . '" display_type="photocrati-nextgen_pro_masonry" override_thumbnail_settings="1"
     size="390" images_per_page="20" spacing="10"]';
                 echo do_shortcode($galleryShortcode);

    This will output a NextGen Gallery in the Plus/Pro Masonary style. I include some thumbnail sizing and other attributes that you might find useful.

    Obviously hard coding these style options will mean all galleries will be the same. If you want more control you would need to create custom fields for each property you want to vary and build this into your shortcode.

    subscribe

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