Title: NextGEN Conditional Statement
Last modified: August 20, 2016

---

# NextGEN Conditional Statement

 *  Resolved [joshrodgers](https://wordpress.org/support/users/joshrodgers/)
 * (@joshrodgers)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/nextgen-conditional-statement/)
 * What I’d like to do is count the number of images for the NextGEN gallery and
   if there are more than 9 images then execute some code…I got close:
 * [http://pastebin.com/pzdgVBjN](http://pastebin.com/pzdgVBjN)
 * This code gets the amount of images and executes the conditional, but it counts
   all the images in the gallery, not just the ones on the current page. If there
   is an easier way than querying the database, that would be awesome as well (I
   prefer not to do that – just didn’t know how to do so any other way).
 * Any ideas?
 * Thanks,
    Josh

Viewing 1 replies (of 1 total)

 *  Thread Starter [joshrodgers](https://wordpress.org/support/users/joshrodgers/)
 * (@joshrodgers)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/nextgen-conditional-statement/#post-3375352)
 * I figured it out!!
 * My final code looks like: [http://pastebin.com/jENKKANp](http://pastebin.com/jENKKANp).
 * Basically the code checks see if the number of images IS larger than the number
   of images displayed per page…if it is larger I `echo` what I want it to do…if
   not, it does nothing.
 * Thanks,
    Josh

Viewing 1 replies (of 1 total)

The topic ‘NextGEN Conditional Statement’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [joshrodgers](https://wordpress.org/support/users/joshrodgers/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/nextgen-conditional-statement/#post-3375352)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
