-1

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, '' );
}
}

?>
Jørgen R
  • 10,568
  • 7
  • 42
  • 59
  • Not enough info. What is the plugin called? Can we see the generated HTML? and the relevant CSS? – Turnip Aug 02 '12 at 13:37

1 Answers1

0

Use either google chrome's inspector or Firefox's Firebug extension to see what kind of classes are being put on your images. Then edit the style.css in your theme to make the necessary changes. Depending on which plugin you're using, you might be able to change the classes or even the alignment with the plugin code but there's no reason not to do it in the css either.

CaldwellYSR
  • 3,056
  • 5
  • 33
  • 50