Title: Programmatically changing a gallery
Last modified: November 2, 2023

---

# Programmatically changing a gallery

 *  Resolved [overbridge](https://wordpress.org/support/users/overbridge/)
 * (@overbridge)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/programmatically-changing-a-gallery/)
 * Thank you for the NextGEN Gallery plugin which I have used via the NextGEN Gallery
   block
 * Having written simple custom plugins in the past I would now like to do something
   similar to programmatically alter which images are displayed in a given gallery.
 * I have NextGEN Gallery free Version 3.4.1 installed and activated. I understand[
   from e.g. the lightbox.php file included in the Version 3.4.1 download] I should
   be able to use in a custom plugin either the internal NextGEN Gallery API or 
   NextGEN Gallery functions.
 * Unfortunately I have not been able to find anywhere with up to date advice exectly
   how to link from my custom plugin to the NextGEN V 3.4.1 plugin and my efforts
   have not worked so far!
 * I would be most grateful is someone could provide the code to use at the head
   of the plugin to allow me to use both the API and the functions approach (not
   at the same time of course – just to provide alternatives).
 * Thanks!

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

 *  [Mihai Ceban](https://wordpress.org/support/users/mihaiimagely/)
 * (@mihaiimagely)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/programmatically-changing-a-gallery/#post-17172946)
 * Hi [@overbridge](https://wordpress.org/support/users/overbridge/),
 * Thanks for reaching out!
   It should be possible to programmatically alter which
   images are displayed in a given gallery with custom code, however I apologize
   as we aren’t able to provide support for this degree of customization.I see you
   mentioned you’ve developed custom plugins in the past, so in case you’d like 
   to look into assistance with custom development we highly recommend using Codeable.
   Codeable screens all developers for you to make sure that they’re highly skilled
   and communicative, and then also helps guide the entire process of connecting
   and communicating with a best-fit developer.In case it helps, here’s an article
   by WPBeginner with more details on Codeable and other reputable sources to hire
   a WordPress developer: [https://www.wpbeginner.com/showcase/best-places-to-hire-wordpress-developers/](https://www.wpbeginner.com/showcase/best-places-to-hire-wordpress-developers/)
   Or if you’d like a team that you can continue coming back to (longer term) for
   custom development help, you might also consider checking out WPBuffs: [https://wpbuffs.com](https://wpbuffs.com)
   If you have any other questions, please feel welcome to let me know!Thanks!
 *  Thread Starter [overbridge](https://wordpress.org/support/users/overbridge/)
 * (@overbridge)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/programmatically-changing-a-gallery/#post-17173071)
 * Hi [@mihaiimagely](https://wordpress.org/support/users/mihaiimagely/)
 * Thanks for your prompt reply. As I am only developing a personal website as a
   hobby in my retirement, I won’t be looking for paid help, but thanks anyway. 
   I also realise that NextGEN cannot provide support for the free version here 
   but I was hoping a fellow user might be able to.
 * My post was prompted by your colleage [@benjaminowens](https://wordpress.org/support/users/benjaminowens/)
   posts where he [provided examples](https://wordpress.org/support/topic/gallery-album-link-in-database/)
   and[ here](https://wordpress.org/support/topic/change-gallery-settings-programmatically/)
   of how to use the internal API but I have not been able to find how to invoke
   it. Perhaps someone can help please?

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

The topic ‘Programmatically changing a gallery’ 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

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

 * 2 replies
 * 2 participants
 * Last reply from: [overbridge](https://wordpress.org/support/users/overbridge/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/programmatically-changing-a-gallery/#post-17173071)
 * Status: resolved