Gallery title, caption and description
-
Looking to get the image title, caption and description showing under my slide show. With this plugin… https://www.ads-software.com/plugins/featured-galleries/
Heres my code…
<?php function getHouseFourSlider($post_id){ $galleryArray = get_post_gallery_ids($post_id); if(empty($galleryArray) || !isset($galleryArray[0]) || empty($galleryArray[0])){ return false; } ?> <style type="text/css"> /* https://www.sitepoint.com/maintain-image-aspect-ratios-responsive-web-design/ */ .rp-big-one-content { background-color: #ededed; display: block; width: 100%; position: relative; height: 0; /* Padding percentage = (landscape image height)/(landscape image width)*100 */ padding: 66.65% 0 0 0; overflow: hidden; } .flexslider img { position: absolute; display: block; max-width: 100%; max-height: 100%; left: 0; right: 0; top: 0; bottom: 0; margin: auto; } </style> <div id="featured-content" class="flexslider"> <ul class="featured-posts slides"> <?php foreach ($galleryArray as $id) { //echo wp_get_attachment_url( $id ); ?> <li id="post-<?=$id?>" class="rp-big-one featured cf" ?> <div class="rp-big-one-content"> <div class="entry-thumb"> <img src="<?=wp_get_attachment_url( $id )?>" class="attachment-zuki-fullwidth wp-post-image" alt="An2.1" /> </div><!-- end .entry-thumb --> </div><!--end .rp-big-one-content --> <?php echo wp_get_attachment_metadata( $id ); ?> </li><!--end .rp-big-one --> <?php } ?> </ul><!-- .featured-content-inner --> </div><!-- #featured-content .featured-content --> <?php return true; }
i tried adding
<?php echo wp_get_attachment_metadata( $id ); ?>
but just got the word Array appearing. Any basic help would be great.Please help!
Thanks.
Jon
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Gallery title, caption and description’ is closed to new replies.