Last active
August 29, 2015 14:22
-
-
Save anestan/75d29814901f01f274e9 to your computer and use it in GitHub Desktop.
icelock - add attachment title for flexslider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "<div class='gallery-wrap'><div class='flexslider'><ul class='slides'>"; | |
foreach ($id as $image_id) { | |
if ( is_single() ) { | |
echo "<li> <a href='". wp_get_attachment_url($image_id) ."'>"; | |
} else { | |
echo "<li> <a href='". get_permalink($post->ID) ."'>"; | |
} | |
echo wp_get_attachment_image($image_id, 'featured-image', false, false); | |
echo "</a>"; | |
$image_title = get_the_title( $image_id ); | |
echo "<p class='flex-caption'>" . $image_title . "</p></li>"; | |
} | |
echo "</ul></div></div>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this to style.css for style above code for flex-caption
.gallery-wrap {
margin-bottom: 60px;
}
.flex-caption {
font-size: 12px;
font-style: italic;
color: #555;
text-align: center;
position: absolute;
left: 0px;
right: 0px;
padding: 10px;
}