Hi i have this code implemented into my wordpress theme?
The code is made to automatically pull all images that are attached to the post, It does just that but it aligns all images underneath one another where do i begin to style this so that the images will appear side by side?
here is the code.
<?php
if ( 'gallery' == get_post_type() ) { //condition to show gallery on post type - gallery
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 wp_get_attachment_link( $attachment->ID, 'full' , false, false, '' );
}
}
?>