Get attachments (get_posts) and WP 3.5 new uploader

I’m using get_posts() to get attachments from the post and use it in the slider. The issue is new uploader doesn’t have that “Gallery” tab which was perfectly suitable for this. It also seems to be breaking original code and you can’t remove / reorder images from this new uploader now. Is there a way to fix this?

The code is below:

        <ul class="slides">

        <?php if ( have_posts() ) : while ( have_posts() ) : the_post();    

         $args = array(

           'post_type' => 'attachment',

           'numberposts' => -1,

           'post_status' => null,

           'post_parent' => $post->ID,

           'order'=> 'ASC', 

           'orderby' => 'menu_order'

          );



          $attachments = get_posts( $args );

             if ( $attachments ) {

                foreach ( $attachments as $attachment ) {

                   echo '<li>';

                   echo wp_get_attachment_image( $attachment->ID, 'full' );

                   echo '</li>';

                  }

             }

         endwhile; endif; ?>
        </ul>
        <!-- slider ends -->

Related posts

Leave a Reply

1 comment

  1. You can still do this with the 3.5 uploader.

    1. Click the Add Media button
    2. Click the Insert Media Tab (top left)
    3. Click the Media Library Tab (top center under Insert Media heading)
    4. Click the Dropdown SELECT box and select Uploaded To This Page
    5. Drag and drop the thumbnails to reorder them as you were able to before

    enter image description here