Title: nextGen shortcode not working
Last modified: December 30, 2020

---

# nextGen shortcode not working

 *  Resolved [taj114](https://wordpress.org/support/users/taj114/)
 * (@taj114)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/nextgen-shortcode-not-working-2/)
 * I am using a shortcode like this. I have the gallery created and named as “LIFE”,
   has 6 images and I was looking for random sorting feature. But the page displays“
   we cannot display this gallery”. Here is the short code:`[ngg src=”galleries”
   ids=”1″ display=”basic_thumbnail” order_by=’rand()’]`
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fnextgen-shortcode-not-working-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [PolyWogg](https://wordpress.org/support/users/polywogg/)
 * (@polywogg)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/nextgen-shortcode-not-working-2/#post-13846402)
 * As a fellow user, you could try two small tweaks to narrow it down:
 * a) Change “basic_thumbnail” to just “thumbnail”; and,
    b) Delete the order_by
   part.
 * That should leave you with the “simplest” of short codes:
 * [ngg src=”galleries” ids=”1″ display=”thumbnail”]
 * If that doesn’t work, is it possible it isn’t gallery 1?
 * PolyWogg
 *  Thread Starter [taj114](https://wordpress.org/support/users/taj114/)
 * (@taj114)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/nextgen-shortcode-not-working-2/#post-13846410)
 * I just need the random sorting feature, so I can’t remove the order_by part. 
   I am using the free version by the way. Is there any restriction on shortcodes
   for free/paid versions?
 *  [PolyWogg](https://wordpress.org/support/users/polywogg/)
 * (@polywogg)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/nextgen-shortcode-not-working-2/#post-13846712)
 * I don’t think so, but you’ll likely have to wait for official support (running
   a bit slower these days than normal). I was more suggesting that you try the 
   other code to make sure that part is working i.e. get the other part working 
   before you tweak the random side. Good luck…
 * P.
 *  [PolyWogg](https://wordpress.org/support/users/polywogg/)
 * (@polywogg)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/nextgen-shortcode-not-working-2/#post-13846727)
 * I tried it on my site, and similar code generates the identical error. If I put
   it in using the block, I get:
 * [ngg src=”galleries” ids=”3″ display=”basic_thumbnail” thumbnail_crop=”0″ order_direction
   =”DESC”]
 * The link I saw had “order_by=’rand()’” but I’m wondering if that’s a typo…the
   normal format would look more like this:
 * [ngg src=”galleries” ids=”3″ display=”basic_thumbnail” thumbnail_crop=”0″ order_by
   =”rand()”]
 * I have caching installed, so it might not show properly for me, but the initial
   load was different than default.
 * However, it does note that not all webhosts will allow the RAND command to be
   used.
 * P.
 *  [Benjamin](https://wordpress.org/support/users/benjaminowens/)
 * (@benjaminowens)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/nextgen-shortcode-not-working-2/#post-13864222)
 * Thanks again PollyWogg!
 * NextGEN Gallery (the free plugin) has NO restrictions whatsoever; our premium
   plugin adds additional features but there is nothing held back to unlock.
 * I have two thoughts:
 * 1) It could be that the text you’re using has specially styled quotation marks;
   they’re pretty (and automatically used by document editors like MS Word) but 
   WordPress cannot handle them. Can you copy / paste this and see if it functions:
   `[
   ngg src="galleries" ids="1" display="basic_thumbnail" order_by="rand()"]`
 * 2) As PollyWogg said some web hosts disable random ordering in their database
   servers. We have an option under Other Options > Misc to enable an alternate 
   random-image ordering algorithm: it’s a little slower and less actually random(
   and not at all random if your gallery has less than 20 or so images) but it’s
   possibly a bandage.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘nextGen shortcode not working’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

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

 * 5 replies
 * 3 participants
 * Last reply from: [Benjamin](https://wordpress.org/support/users/benjaminowens/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/nextgen-shortcode-not-working-2/#post-13864222)
 * Status: resolved