Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to display all the images added as gallery in a post with prettyphoto class.

I am using this code.

    <?php
        /* The loop */
        while ( have_posts() ) : the_post();
            if ( get_post_gallery() ) :
                $gallery = get_post_gallery( get_the_ID(), false );

             /* Loop through all the image and output them one by one */
                foreach( $gallery['src'] AS $src )
                {
                    ?>

                 <a href="<?php echo $src; ?>" rel="prettyPhoto[pp_gal]"><img src="<?php echo $src; ?>"  alt="Gallery image"  /></a>

                <?php
                }
            endif;
            endwhile;
    ?>

Its is displaying the photos but it is showing only thumbnail as src. I want to display Full Image.

How can i display full image instead of thumbnail ?

share|improve this question
    
work on your acceptance rate, if somebody gives you an answer which helps you to resolve your issue, then mark it as correct –  Eugene Manuilov Oct 15 '13 at 11:32

3 Answers 3

TutsPlus did a pretty straightforward article on exactly this a while back. Perhaps you could give it a read and let us know if you run into any problems? This forum is good with problems. The basis of your question is more of a "point me at a tutorial" issue though. Done and done :)

You may need to refer to a code snip like this to get gallery integration though, once you've done the basics.

share|improve this answer

Try this

// Query the custom post type to display
$args = array('post_type' => 'CUSTOM POST TYPE');
$query = new WP_Query( $args );

if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
   // your gallery loop
endwhile; endif;
share|improve this answer
    
Please add an explanation to your answer: why could that solve the problem? –  toscho Oct 15 '13 at 11:47

Read the documentation for get_post_gallery and you'll see that the function is intended to return thumbnail image sources. The function also returns a string IDs of images. So you can split it into array, and run wp_get_attachment_link within the same loop (with a defined index to reference correct image file ID) to query for full image source.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.