• 1.
    $thumb_ID = get_post_thumbnail_id( $post->ID ); // EXCLUDE USE THE FEATURED IMAGE
  • 2.
    		$images =& get_children( array (
  • 3.
    			'post_parent' => $post->ID,
  • 4.
    			'order' => 'ASC',
  • 5.
    			'orderby' => $orderby,
  • 6.
    			'post_type' => 'attachment',
  • 7.
    			'post_mime_type' => 'image',
  • 8.
    			'exclude' => $thumb_ID // EXCLUDED
  • 9.
    		));
  • 10.
    		
  • 11.
    		foreach ( $images as $attachment_id => $attachment ) { // SUPPORT FOR CUSTOM EXPORT - CLASS AND CAPTION (VIEW.JS)
  • 12.
    			$imageUrl = wp_get_attachment_image_src( $attachment->ID, 'portfolio-single' );
  • 13.
    			$caption = $attachment->post_excerpt;
  • 14.
    		 
  • 15.
    				echo '<li class="stacked-image">';
  • 16.
    				echo '<img src="'.$imageUrl[0].'"/>'; 
  • 17.
    				if ( $caption != '' ) { echo '<h6 class="media-caption">'; echo $caption; echo '</h6>'; } //CAPTIONS
  • 18.
    				echo '</li>';
  • 19.
    			
  • 20.
    		} // END FOR EACH IMAGE
$thumb_ID = get_post_thumbnail_id( $post->ID ); // EXCLUDE USE THE FEATURED IMAGE $images =& get_children( array ( 'post_parent' => $post->ID, 'order' => 'ASC', 'orderby' => $orderby, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'exclude' => $thumb_ID // EXCLUDED )); foreach ( $images as $attachment_id => $attachment ) { // SUPPORT FOR CUSTOM EXPORT - CLASS AND CAPTION (VIEW.JS) $imageUrl = wp_get_attachment_image_src( $attachment->ID, 'portfolio-single' ); $caption = $attachment->post_excerpt; echo '<li class="stacked-image">'; echo '<img src="'.$imageUrl[0].'"/>'; if ( $caption != '' ) { echo '<h6 class="media-caption">'; echo $caption; echo '</h6>'; } //CAPTIONS echo '</li>'; } // END FOR EACH IMAGE

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter