Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Apollo139

    (@aloziak)

    The example code is on Descirption page of the plugin.

    This is probably the code you are looking for with a repeater field. It’s tested and works on my site:

    <?php // Loop through a Repeater field
    	if( get_field('role_network_gallery_repeater') ): ?>
    		<h2>Photos</h2>
    			<?php while( has_sub_field('role_network_gallery_repeater') ): ?>
    				<?php foreach ( get_sub_field ( 'role_network_gallery' ) 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; ?>
    				<?php endwhile; ?>
    			<?php endif; wp_reset_postdata() //Reset ?>

    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘will this work in a repeater?’ is closed to new replies.