Gallery Only Displaying One Thumbnail

My image galleries are showing only one thumbnail in the post the gallery sits in. http://themeforward.com/demo2/2013/03/08/image-gallery/

My single.php markup can be found here: http://snippi.com/s/akm5jb7

Read More

Additionally, previous_image_link and next_image_link are not displaying when the image is clicked (these would lead to the other images in the gallery).

My entire image.php markup can be found here: http://snippi.com/s/ajwa5yh

My gallery shortcode:

Related posts

Leave a Reply

2 comments

  1. Try this and verify that the attachments come back correctly when queried directly:

    // helper function to return first regex match
    function get_match( $regex, $content ) {
        preg_match($regex, $content, $matches);
        return $matches[1];
    } 
    
    // Extract the shortcode arguments from the $post
    $shortcode_args = shortcode_parse_atts(get_match('/[gallerys(.*)]/isU', $post->post_content));
    
    // get the attachments specified in the "ids" shortcode argument
    $attachments = get_posts(
        array(
            'include' => $shortcode_args["ids"], 
            'post_status' => 'inherit', 
            'post_type' => 'attachment', 
            'post_mime_type' => 'image', 
            'order' => 'menu_order ID', 
            'orderby' => 'post__in', //this forces the order to be based on the order of the "include" param
        )
    );
    
    echo 'gallery count:' . count( $attachments );
    

    If that count is correct, then the gallery shortcode should be returning correctly. Let me know what that returns.