WordPress 3.5 and Galleries

I am some difficulty working with the new galleries in WordPress 3.5. Here is a brief description of the problem we are having.

Project Details

Read More

Desktop and Mobile site generated from the same WP install

Currently using a modified version of swipe http://swipejs.com/ for a mobile slider that supports getting more post attachments with an offset

What we require

A way to embed the same gallery on multiple pages

Picture listing type gallery for Desktop site

Slider Gallery for mobile that support swiping, display one image at a time when swiped will get another image with ajax and display it

Problems

Wordress 3.5 no longer attaches images for galleries, cannot use get post attachments to get images used in gallery

Tried nextgen gallery but can’t find a way to have more than 2 image sizes for a gallery, we would need a desktop thumbnail, the original image, and a mobile sized image

Any suggestions how to approach this problem?

Thanks!

Related posts

Leave a Reply

2 comments

  1. If you upload to a post it will still set that relation. There is a option to display ‘images uploaded to this post’ in the gallery. in the media manager. SO I don’t know what you mean with:

    cannot use get post attachments

    What code are / where you using to display the gallery?

  2. Till 3.5 You could get all attachments images id with:

    $attachments = get_children( array('post_parent' => $post_id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
    

    where $post_id is an id of current post, $order and $order_by are standard query variables (ASC, menu_order in standard)

    Then with images ID You can get them all using foreach and calling:

    wp_get_attachment_link
    

    to get a link to image, or to get completly html img code with alts, widths etc:

     wp_get_attachment_image
    

    Should work well in 3.5, so You could upload all images to one post and use it as a placeholder for displaying entire gallery anywhere.