Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_image_size( 'list-thumbnail', 200, 120, true );
- function dr_Get_Post_Images() {
- global $post;
- $img_args = array(
- 'post_type' => 'attachment',
- 'numberposts' => -1,
- 'post_status' => null,
- 'post_parent' => $post->ID
- );
- $attachments = get_posts( $img_args );
- if ( $attachments ) {
- $counter=0;
- echo '<div class="row">';
- foreach ( $attachments as $attachment ) {
- $counter++;
- $class = ( $counter % 3 ) ? '<div class="third">' : '<div class="third last">';
- echo $class;
- echo wp_get_attachment_image( $attachment->ID, 'list-thumbnail' );
- echo '</img></div>';
- }
- echo '</div>';
- echo '<div style="clear:both;"></div>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement