Title: Multisite gallery
Last modified: August 31, 2016

---

# Multisite gallery

 *  Resolved [skorzeniowski](https://wordpress.org/support/users/szkorzonek/)
 * (@szkorzonek)
 * [10 years ago](https://wordpress.org/support/topic/multisite-gallery-1/)
 * Hi!
    I was wondering if it is possible to upload gallery only once and than use
   it across all sites in WordPress multisite. I have multisite enabled for multilingual
   support on my page and sites share the same content, so I would like to avoid
   wasting space by uploading images twice. I tried to find solution on this forum,
   but unfortunately all posts regarding mentioned issue were 4 years old. Thank
   you in advance, Szymon.
 * WordPress: 4.5.1
    NextGEN Gallery: 2.1.31 theme: Sydney by aThemes other plugins:
   Accordions (2.0.7), Akismet (3.1.10), Contact Form 7 (4.4.1), Google Maps Ready!(
   1.3.1), Maintenance (2.7.1), Events Manager (5.6.3.1), Menu Image (2.6.3), Page
   Builder by SiteOrigin (2.4.6), SEO Ultimate (7.6.5.8), Simple Custom CSS (3.3),
   Sydney Portfolio (1.0), Sydney Toolbox (1.01), Toolset Types (2.0.1), WordPress
   Importer (0.6.1), WP FullCalendar (1.2).
 * [https://wordpress.org/plugins/nextgen-gallery/](https://wordpress.org/plugins/nextgen-gallery/)

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

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years ago](https://wordpress.org/support/topic/multisite-gallery-1/#post-7350793)
 * [@szkorzonek](https://wordpress.org/support/users/szkorzonek/) – The following
   should help you to accomplish this:
 *     ```
       add_filter('ngg_datamapper_table_name', 'something', 10, 2);
       function something( $table_name, $name ) {
         global $table_prefix;
         if ( strpos( $table_name, ‘ngg' ) !== FALSE ) {
           return $table_prefix . $name;
         }
       }
       ```
   
 * The callback function is noted as “something” use whatever is most appropriate
   for your installation.
 * The return value of `$table_prefix . $name` will return by default the main WordPress
   installation site, if you want to use a different sub-site then set the `$table_prefix`
   appropriately, for example, site 3 would use `wp_3_` as the `$table_prefix`
 * Also to note, all images should be uploaded to the specific site being used for
   all the other sub-sites.
 * Thanks!
 * – Cais.
 *  Thread Starter [skorzeniowski](https://wordpress.org/support/users/szkorzonek/)
 * (@szkorzonek)
 * [10 years ago](https://wordpress.org/support/topic/multisite-gallery-1/#post-7350834)
 * Dear Cais,
    thank you very much for taking a look at this thread. I tried to 
   follow steps you mentioned, but unfortunately each time I read your hint I understand
   less. It seems I am a newbie in this kind of problems. If you be so kind and 
   simplify the solution, I would appreciate it a lot. Thank you again, Szymon.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years ago](https://wordpress.org/support/topic/multisite-gallery-1/#post-7350849)
 * [@szkorzonek](https://wordpress.org/support/users/szkorzonek/) – Copy and paste
   the code snippet into every theme you are using on the Multisite instance and
   only use the main (read: first) sub-site to upload images to. You will need to
   maintain this with every update to every theme in use as well.
 * I would say the most simplified method, and least prone to possible issues, is
   to not use the code and upload the images as needed to each specific sub-site.
 * Thanks!
 * – Cais.
 *  Thread Starter [skorzeniowski](https://wordpress.org/support/users/szkorzonek/)
 * (@szkorzonek)
 * [10 years ago](https://wordpress.org/support/topic/multisite-gallery-1/#post-7350863)
 * Dear Cais,
    I noticed what I had been doing wrong – there is single quotation
   mark instead of apostrophe in 4th line of your code. Unfortunately even if I 
   successfully upload the code (to functions.php) and plugin is set up correctly,
   it seems not to work. I have the gallery path _wp-content/uploads/nggallery/_
   and all pictures upload there, but none of them shows up in the plugin overview/
   manage galleries option of different sub-site that used to upload, never mind
   the sub-site I use to upload. There is also one more interesting thing I noticed.
   When I create a post and add gallery to it via button _Attach NextGEN Gallery
   to Post_ there shows up only that gallery, which was uploaded to that sub-site,
   but when I copy-paste the code from post’s text builder to the other site on 
   building mode (or when I insert a shortcode) a thumbnail of gallery of other 
   sub-site appears! Unfortunately after publishing this post instead of gallery
   there is only _Invalid Displayed Gallery_ (or _no images were found_) text. Have
   you got any ideas of fixing this? Thank you very much! Szymon
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [10 years ago](https://wordpress.org/support/topic/multisite-gallery-1/#post-7350866)
 * [@szkorzonek](https://wordpress.org/support/users/szkorzonek/) – You will need
   to use the standard Multisite installation setting for the gallery path option(`
   wp-content/uploads/sites/%BLOG_ID%/nggallery/`) under Network Plugins > Gallery
   for the above code to work.
 * – Cais.
 *  Thread Starter [skorzeniowski](https://wordpress.org/support/users/szkorzonek/)
 * (@szkorzonek)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/multisite-gallery-1/#post-7350881)
 * Dear Cais,
    I am sorry for lack of respond. I followed every step you mentioned(
   edit `functions.php`, edit gallery path option to default `wp-content/uploads/
   sites/%BLOG_ID%/nggallery/` in multisite settings) and unfortunately it does 
   not work. Neither galleries show in second sub-site dashboard nor using shortcode
   made them appear after publishing the post. I have noticed, that on my first 
   sub-site I have got option to change path where my galleries are stored (like
   on multisite settings), but on the second one this setting is missing. I really
   enjoyed using this plugin while not having multisite active, so please, have 
   you got any more hints? Regards, Szymon
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/multisite-gallery-1/#post-7350886)
 * [@szkorzonek](https://wordpress.org/support/users/szkorzonek/) – This has worked
   in other instances and was one of the reasons this particular filter was added
   to the code. Although strictly speaking this is a “customization” to NextGEN 
   Gallery you are welcome to send us a Bug Report ([https://imagely.com/report-bug/](https://imagely.com/report-bug/)…
   please reference this topic) so we can get a better look under the page at your
   site.
 * Please include as many details as you can about your site and the issue at hand
   so we can review this further.
 * Thanks!
 * – Cais.
 *  [jlillibridge](https://wordpress.org/support/users/jlillibridge/)
 * (@jlillibridge)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/multisite-gallery-1/#post-8175468)
 * I’m having the same issue and was wondering if you ever resolved this issue?
 *  Thread Starter [skorzeniowski](https://wordpress.org/support/users/szkorzonek/)
 * (@szkorzonek)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/multisite-gallery-1/#post-8175579)
 * [@jlillibridge](https://wordpress.org/support/users/jlillibridge/) , I worked
   around this problem and I uploaded pics to a gallery on Google+. There is quite
   nice plugin to show whole gallery on a page as a list of thumbnails, so it works
   for me, especially for huge or often updated galerries. For smaller and constant
   one I upload photos to each sub-site and use NextGEN Gallery plugin to show them.
   
   I did not send plugin authors any bug report, so if you need more help feel free
   to use guidelines in the last Cais’ post. Regards, Szymon
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/multisite-gallery-1/#post-8178603)
 * [@jlillibridge](https://wordpress.org/support/users/jlillibridge/) – It is generally
   best to start a new topic if you have not found any resolutions within a topic’s
   suggestions.
 * That being the case, please start your own topic so we can try to help you with
   your specific issue on your specific site.
 * See [http://codex.wordpress.org/Forum_Welcome#Where_To_Post](http://codex.wordpress.org/Forum_Welcome#Where_To_Post)
 * Thanks!
 * – Cais.

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

The topic ‘Multisite 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

 * [gallery](https://wordpress.org/support/topic-tag/gallery/)
 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [Sites](https://wordpress.org/support/topic-tag/sites/)

 * 10 replies
 * 3 participants
 * Last reply from: [photocrati](https://wordpress.org/support/users/photocrati/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/multisite-gallery-1/#post-8178603)
 * Status: resolved