how to display images of custom post

i have a custom post type-> events. I have a gallery page in which the featured image from a custom post is used as album cover . Now when a person clicks on the album cover i.e featured image , i want to display images in attached gallery in the post. I have been using the following code to display the featured images in the main gallery page .But how do i show the rest of the images of the post. Please help me out.

 <?php $paged= (get_query_var('paged' )) ? get_query_var('paged'):1; ?>
                    <?php $args = array( 'post_type'=>'events',
                                         'posts_per_page' => 100 ,
                                         'paged'=>$paged
                                       );

                    $loop = new WP_Query( $args );
                    if($loop->have_posts()):while ( $loop->have_posts() ) : $loop->the_post();  

                    ?>

                    <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array(225,225) ); ?>
                    <?php if(!$image) :continue; else:?>



                                <div class="col-lg-3 col-md-3 col-sm-3 gallerycol paddingdel-l">
                                    <div class="about-img">
                                            <div class="about-img-bot">
                                                <div class="photo-quanity"></div>
                                            </div>
                                            <img class="img-responsive" src="<?php echo $image[0]; ?>" alt="" />
                                        </div>
                                        <div class="clearfix"></div>
                                    <p><?php the_title(); ?> </p>
                                </div>

                    <?php endif; ?>  
                    <?php endwhile;endif; ?> 

Any hint will be really helpful and appreciable

Read more here: how to display images of custom post

Leave a Reply

Your email address will not be published. Required fields are marked *