Ok so i am using this code, which allows me to upload photo's to a post and instead of inserting them myself, it calls all the photos attached to the post. Thus for placing all the photos in the post by itself. But what i did was made this page int a gallery where i use a jquery jcarousel where they can click the arrows to go to the next photo.
here is the code
<?php
if ( 'photos' == get_post_type() ) { //condition to show gallery on post type - photos
if ( $attachments = get_children( array(
'post_type' => 'attachment',
'post_mime_type'=>'image', //return all image attachment only
'numberposts' => -1, //get all the attachments
'post_parent' => $post->ID
)));
foreach ($attachments as $attachment) {
// you can customize the oputput
echo '<li><center>';
echo wp_get_attachment_link( $attachment->ID, 'full' , false, false, '' );
echo '<span class="img_cap">'.$attachment->post_excerpt.'</span>';
echo '</center></li>';
}
}
?>
But how do i get the post_excert part of the code which is the caption, to align left of the image, what do i add to the code and where, or is this something i do in css.
echo '<span...andecho wp_get_attachment_link(...lines around. To thespanline add astyleattribute:echo '<span style="float:left;margin-right:1em" class=...– w3d Aug 15 '12 at 0:15