Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Portfolio Loop

Portfolio Loop

// Add Shortcode
function portfolio_loop() {

	 <?php
	                        
	                        
	                        $args = array('post_type' => 'portfolio');
	                        
	                            $loop = new WP_Query( $args );
	
	                                if( $loop->have_posts() ):
	                                    while( $loop->have_posts() ): $loop->the_post();
	
	                                        foreach($args as $value) {
	                                        
	                                        the_post_thumbnail('large', array('class' => 'img-responsive center'));
	                                        
	                                        }
	                    
	                                        endwhile;
	                                        
	                                        wp_reset_postdata();
	                                        
	                                        ?>

}
add_shortcode( 'tag', 'portfolio_loop' );