Image slider only showing image title on first image
-
I am working on a slider and I have added the image title to each image. The problem is only the first image in the slideshow is showing the title. None of the rest are. Here’s the code:
<?php $check_imgs = get_post_meta( $post->ID, 'custom_otw-portfolio-repeatable-image', true); if( !empty( $check_imgs[0] ) ) { ?> <div class="portfolio-gallery-wrapper"> <div class="flexslider" id="portfolio-gallery" style="margin-bottom:10px;"> <div class="flex-viewport" style="overflow: hidden; position: relative;"><ul class="slides" style="width: 1600%; transition-duration: 0s; transform: translate3d(0px, 0px, 0px);"> <?php $post_meta_data = get_post_custom($post->ID); $custom_repeatable = unserialize($post_meta_data['custom_otw-portfolio-repeatable-image'][0]); foreach ($custom_repeatable as $custom_image) { $url = wp_get_attachment_image_src($custom_image, 'otw-porfolio-large'); $custom_image_title = get_post(get_post_thumbnail_id())->post_title; echo '<li data-thumb="'.$url[0].'" style="width: 700px; float: left; display: block;"><img alt="" src="'.$url[0].'"></li>'; echo '<div class= "flexslider-title">'; echo $custom_image_title; echo '</div>'; } ?> </ul></div><ul class="flex-direction-nav"><li><a href="#" class="flex-prev flex-disabled"><?php _e( 'Previous', 'otw_pfl' ); ?></a></li><li><a href="#" class="flex-next"><?php _e( 'Next', 'otw_pfl' ); ?></a></li></ul></div> <?php ?> <div class="flexslider" id="portfolio-carousel" style="margin-bottom:10px;"> <div class="flex-viewport" style="overflow: hidden; position: relative;"><ul class="slides" style="width: 1600%; transition-duration: 0s; transform: translate3d(0px, 0px, 0px);"> <?php $post_meta_data = get_post_custom($post->ID); $custom_repeatable = unserialize($post_meta_data['custom_otw-portfolio-repeatable-image'][0]); foreach ($custom_repeatable as $custom_image) { $url = wp_get_attachment_image_src($custom_image, 'otw-porfolio-large'); echo '<li data-thumb="'.$url[0].'" style="width: 210px; float: left; display: block;"><img alt="" src="'.$url[0].'"></li>'; } ?> </ul></div><ul class="flex-direction-nav"><li><a href="#" class="flex-prev flex-disabled"><?php _e( 'Previous', 'otw_pfl' ); ?></a></li><li><a href="#" class="flex-next"><?php _e( 'Next', 'otw_pfl' ); ?></a></li></ul></div> </div> <?php } ?>
Any help is appreciated
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Image slider only showing image title on first image’ is closed to new replies.