Title: NextGen Gallery PHP code for [random max=x]
Last modified: August 19, 2016

---

# NextGen Gallery PHP code for [random max=x]

 *  [keithdevon](https://wordpress.org/support/users/keithdevon/)
 * (@keithdevon)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/nextgen-gallery-php-code-for-random-maxx/)
 * Does anyone know the PHP code to achieve the same as the shortcode `[random max
   =? id=?]`
 * I’m currently using `<?php
    if (function_exists(“nggDisplayRandomImages”)) { 
   nggDisplayRandomImages(‘6’,$Width,$Height); } ?>` but I need to pull the images
   from a specific gallery.
 * Thanks for your help.

The topic ‘NextGen Gallery PHP code for [random max=x]’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [keithdevon](https://wordpress.org/support/users/keithdevon/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/nextgen-gallery-php-code-for-random-maxx/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
