Title: 3.5.1 Gallery problems
Last modified: August 20, 2016

---

# 3.5.1 Gallery problems

 *  [pan69](https://wordpress.org/support/users/pan69/)
 * (@pan69)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/351-gallery-problems/)
 * In previous versions of WP you were able to save a gallery without actually inserting
   it into a post. This was handy since it allowed for easy gallery creation that
   wasn’t part of the core content of your page.
 * I used to use the following function to retrieve the gallery but unfortunately
   this no longer works with the revamped gallery functionality since the Save Gallery
   option is no longer there:
 *     ```
       function get_gallery( $post_ID = NULL )
       	{
       		global $wpdb;
   
       		if( empty( $post_ID ) )
       		{
       			$post_ID = get_the_ID();
       		}
   
       		$gallery = $wpdb->get_results(
       			$wpdb->prepare("
       				SELECT * FROM ".$wpdb->prefix."posts
       				WHERE
       				post_parent=%d
       				AND
       				post_type='attachment'
       				AND
       				menu_order > 0
       				AND
       				post_status='inherit'
       				AND
       				post_mime_type LIKE '%%image%%'
       				ORDER BY menu_order ASC", $post_ID
       			)
       		);
   
       		return $gallery;
       	}
       ```
   
 * Is there any way to retrieve a gallery in a similar fashion with the new gallery
   functionality?

The topic ‘3.5.1 Gallery problems’ is closed to new replies.

## Tags

 * [gallery](https://wordpress.org/support/topic-tag/gallery/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [pan69](https://wordpress.org/support/users/pan69/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/351-gallery-problems/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
