The MediaPress Gallery loop is used to list the results of main MediaPress gallery query. If you are looking for custom loop, please see MPP_Gallery_Query.
Standard Loop Example:-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | <?php if ( mpp_have_galleries() ): ?> <?php while( mpp_have_galleries() ): mpp_the_gallery(); ?> <div class="<?php mpp_gallery_class( );?>" id="mpp-gallery-<?php mpp_gallery_id();?>"> <div class="mpp-item-meta mpp-gallery-meta mpp-gallery-meta-top"> <?php do_action( 'mpp_gallery_meta_top' );?> </div> <div class="mpp-item-entry mpp-gallery-entry"> <a href="<?php mpp_gallery_permalink() ;?>" <?php mpp_gallery_html_attributes( array( 'class' => 'mpp-item-thumbnail mpp-gallery-cover' ) ); ?>> <img src="<?php mpp_gallery_cover_src( 'thumbnail' ) ;?>" alt ="<?php echo esc_attr( mpp_get_gallery_title() );?>" /> </a> </div> <?php do_action( 'mpp_before_gallery_title' ); ?> <a href="<?php mpp_gallery_permalink() ;?>" class="mpp-gallery-title"><?php mpp_gallery_title() ;?></a> <?php do_action( 'mpp_before_gallery_actions' ); ?> <div class="mpp-item-actions mpp-gallery-actions"> <?php mpp_gallery_action_links();?> </div> <?php do_action( 'mpp_before_gallery_type_icon' ); ?> <div class="mpp-type-icon"><?php do_action( 'mpp_type_icon', mpp_get_gallery_type(), mpp_get_gallery() );?></div> <div class="mpp-item-meta mpp-gallery-meta mpp-gallery-meta-bottom"> <?php do_action( 'mpp_gallery_meta' );?> </div> <?php do_action( 'mpp_after_gallery_entry' ); ?> </div> <?php endwhile; ?> <?php mpp_reset_gallery_data();?> <?php else:?> <div class="mpp-notice mpp-no-gallery-notice"> <p> <?php _ex( 'There are no galleries available!', 'No Gallery Message', 'mediapress' ); ?> </div> <?php endif;?> |
In the loop, we use various template tags to list various attributes of the gallery.