Title: [Plugin: NextGEN Gallery ] PHP Code Accessing Gallery
Last modified: August 19, 2016

---

# [Plugin: NextGEN Gallery ] PHP Code Accessing Gallery

 *  [jedix878x](https://wordpress.org/support/users/jedix878x/)
 * (@jedix878x)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-php-code-accessing-gallery/)
 * Hi all,
 * In an blog post entry, I have two views that the user can switch from. The first
   view is a straight list view of all the images that is included in a gallery 
   for that specific post. The second view that the user can switch to is an image
   and some text. This image, however, needs to be randomized from the gallery. 
   So every time the page is accessed or refreshed, the image changes.
 * Does anyone know how to access a gallery for a specific post, which in turn I
   can use to access a random image from that gallery? All I have as a reference
   is the postID, which I have no idea how to look for an attached gallery. I would
   like to do this in PHP.

The topic ‘[Plugin: NextGEN Gallery ] PHP Code Accessing Gallery’ is closed to new
replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [jedix878x](https://wordpress.org/support/users/jedix878x/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-php-code-accessing-gallery/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
