jon.p1688
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Forum: Plugins
In reply to: [Featured Galleries] Gallery title, caption and descriptionFixed it…
<?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: white; 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 ); //echo wp_get_attachment_metadata( $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 //Get the 'post' for each image $slider_post = get_post($id); ?> <div class="slide-title"><h3><?=$slider_post->post_title?></h3></div> <div class="slide-content"><p><?=$slider_post->post_excerpt?></p></div> <!--<div class="slide-excerpt"><p><?=$slider_post->post_content?></p></div>--> </li><!--end .rp-big-one --> <?php } ?> </ul><!-- .featured-content-inner --> </div><!-- #featured-content .featured-content --> <?php return true; }
Viewing 1 replies (of 1 total)