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 ,
                    $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>
                                            <img class="img-responsive" src="<?php echo $image[0]; ?>" alt="" />
                                        <div class="clearfix"></div>
                                    <p><?php the_title(); ?> </p>
                    <?php endif; ?>  
                    <?php endwhile;endif; ?> 

If i take the featured image in the anchor tag with href=”the_permalink” then it takes me to the template single-events.php which is having a lot of infomation . How do i display only the images in the attached gallery
Any hint will be really helpful and appreciable

Read more here: Display images in attched gallery of custom post type


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , , ,

Wordpress related questions and answers: