Sync with a Page / Gallery

This article is difficult to name properly but basically, you are here because you would like to sync your collection of photos in Lightroom with a certain (type of) page on your website and/or a gallery.

How WP/LR Sync works

First, let’s recap what the plugin does. WP/LR Sync uploads and keeps your photos synchronized with the Media Library. This is its main function. The plugin uses WordPress naturally, without hacking it, in order to be 100% compatible with all the WordPress processes.

WP/LR Sync does two more things, a bit less obvious:

  • it keeps the hierarchy of folders and collections in its own database in your WordPress, and make it accessible to developers. Therefore, if any plugin or theme wants to get this info, it can.
  • it shares with other plugins/themes events about the synchronization. For instance, such events are: a folder is created, a collection is added to it, an image is added (or updated) to a certain collection, another one being deleted, etc. Any other plugin or theme can react based on those events.

Now, you can link a collection with a gallery shortcode or you can link through a clever process all this data to your WordPress through WP/LR Sync Extensions. Or maybe you are using one of the Gallery Systems available.

Standard WP Gallery

The standard WP Gallery is the one using the shortcode “gallery” and included with WordPress from the start. To use it with WP/LR Sync, it is very simple. Visit the menu called “Collections & Keywords” under WP/LR Sync in your WordPress. By hovering with your mouse over your collections and keywords, the plugin will generate a little shortcode on the right side. You can simply copy/paste it and insert it somewhere on your website.

Sync with Galleries

Don’t worry if the WordPress Post Editor can’t display the images right away in the preview. It does it when the page is generated, so visit it directly. Any images added to your collection in Lightroom will be automatically part of this without any updated required (except maybe caching).

This process is totally natural to WordPress and a gallery such as the Meow Gallery can make it even prettier (or any other gallery system that is using WordPress naturally).

Meow Gallery

WP/LR Sync Extensions

This kind of page should be called a post-type. A post-type can be a post (standard), a page (standard), a portfolio, an album or whatever else. Those pages are defined by your theme, sometimes by other plugins. The way they exactly work is only known by that theme or plugin.

Between WP/LR Sync and your Theme

You probably now understand that there is no direct natural link between a collection and a page on your website. They have nothing in common. But WP/LR Sync has data (and events) that can be used to sync more things on your website. Of course, WP/LR Sync can’t guess how the data should be used or what should be done since all the themes are different.

This glue between WP/LR Sync and Themes is made through the WP/LR Extensions. You can check on the subject here.

Extensions

Developers or Theme Developers can make their own extension for WP/LR Sync. That would be the easiest for the users, but they often don’t know WP/LR Sync yet or don’t have any time to allow to make one.

I made a generic extension called Post Types that covers most of the themes. It basically works with all the themes handling galleries, portfolios, posts or other post-types in a natural WordPress way. You can check the information and tutorial about it here: Post Types Extension.

3. Gallery Systems (NextGen, FooGallery, etc.)

There are many gallery systems available, more or less old and more or less using WordPress naturally. Prefer systems which are using the Media Gallery in a natural way, to avoid issues in the future.

NextGen

NextGen is unfortunately not working at all naturally with WordPress, and therefore, you will not be able to easily link your collections to the NextGEN galleries through WP/LR Sync. NextGen is not even using the Media Library. You can import images to their system from the Media Gallery through another plugin (Media Library Importer for NextGEN), but that is extremely dirty. One day, if you move to a nice theme, a different gallery system, or simply the natural WordPress Gallery system, all your work will be lost. I made an extension for NextGEN in the past and it worked, but it’s too much work to keep it up and I don’t think it worth it. If you are interested, it is on GitHub.

FooGallery

A better example is FooGallery. It doesn’t use the WP Gallery, it creates its own shortcode but works naturally with WordPress and the Media Library. You can have WP/LR Sync synchronized with the FooGallery using the Post Types extension with those settings:

  • Post Type: foogallery
  • Mode: Array in Post Meta
  • Post Meta: foogallery_attachments

And Others…

In all cases, WP/LR Sync will always synchronize with your WordPress and your Media Library whatever system you are using, and you will be always able to use and create galleries through the previously discussed processes in the future if you wish.

If you have any further questions, please feel free to ask me below in the comments. Thank you πŸ™‚

  • E.R. Hamilton

    Well, I thought I was close. I found the Post Meta value for my theme from the developer (_mtheme_images_ids) and plugged it into the array option. Now, at least the photos upload where I can see them – but only as attachments – where the portfolio plugin should be (big step forward, but still not fully incorporated into the portfolio element of iMaginem page builder). However in addition to photos only being attachments, I now see the error in the backend of iMangenium:

    Warning: explode() expects parameter 2 to be string, array given in /home/myemmanuelramses/public_html/wp-content/themes/kinetika/framework/metaboxgen/metaboxgen.php on line 291

    Warning: Invalid argument supplied for foreach() in /home/myemmanuelramses/public_html/wp-content/themes/kinetika/framework/metaboxgen/metaboxgen.php on line 293

    After a few searches, I realized this is over my head to try and diagnose.

    One thing I noticed is that after several attempts to get the iMaginem portfolio to play nice with your plugin, I am now getting “phantom” collections, even after a database clean and reset. After every attempt to change the Post Meta, I did a database clean and reset to start fresh Lightroom upload attempts. Also, I consistently used the “reuse” option with respect to the taxonomy, but after a resync, the plugin is now populating deleted collection folders that do not exist in Lightroom or WordPress. As I try my luck with a different plugin with a portfolio gallery, is there a fix for the duplicate and phantom folder issue? Thanks again for the help.

    • The easiest way here is to ask your theme how they store the information in the meta field, as my extension gives you the choice of two way of doing this (an array of IDs and an indexed array based on the IDs). Unfortunately this is highly technical, this is not the fault of either my plugin nor the theme you are using but clarification needs to be made so that you can achieve this “linking”. Based on the error you showed me, the “Array of (ID -> FullSize) in Post Meta” would have more chance to work than “Array in Post Meta”.

      WP/LR Sync can delete whatever it has created in the Extensions screen (using the Reset Extensions and the same settings as used to Sync them). If you reset WP/LR Sync database, it doesn’t know anything about it anymore, so it can’t delete those.

      You were very close indeed. Trying another gallery working directly with a plugin that upload from LR (I know only one and it’s a terrible one; you can only use their solution and then you are locked forever) will be a lot of additional pain :/ I think it is best to try to make a successful sync with one gallery (not more than one as long as it doesn’t work) and when you do, then everything will be magic and clean (and will also adapt to a new theme or gallery plugin if one day you want to change).

      • E.R. Hamilton

        Again thank for all the help. And just so I’m clear, I’m looking for the “Array of (ID -> FullSize) in Post Meta” value? And, I input this value into the Post Meta field in your plugin?

        Regarding the database, definitely a possibility I cleared it before resetting, so I’ll have to deal with the phantom folders. And thank for the good advice regarding another gallery. I’ll stay put.

        • You simply need to “Array of (ID -> FullSize) in Post Meta” as the Method in the Post Types extension, and “_mtheme_images_ids” as the Post Meta. Then create a new collection in the Publish Service and add a few photos in it to see if it works.

          • E.R. Hamilton

            Unfortunately that didn’t work for me either. The images still upload but post only as attachments. My developer told me this:

            “Check the function in /kinetika/framework/functions/framework-functions.php
            Line 953
            Name of function mtheme_get_custom_attachments

            After getting the data you can use the PHP explode command to separate the comma deliminated values.”

            I’m not sure that I can accomplish what I want by simply changing the values in the plugin.

          • I might have an idea. I feel like your theme (is it an old theme?) might be using a string of an array instead of simply an array. Of course I can support that too, I would need to add another option. Can you contact me directly so that I can try?

          • E.R. Hamilton

            I’m not sure whether it is an old theme, here it is: https://themeforest.net/item/kinetika-fullscreen-photography-theme/12162415.
            And, please let me know what information to provide to you.

          • The best would be to ask your theme developer to provide me the theme so that I can try it and make WP/LR Sync works with it. Can you ask them? Then you can contact me through here: https://meowapps.com/contact/

          • E.R. Hamilton

            Can I provide you a copy or does it need to come directly from developer?

          • Mmm, it is better to ask first, but they always say yes πŸ™‚ (in my experience)

          • E.R. Hamilton

            Ok I’m on it.

          • Just an update to say that it works now, and that the Post Type extension was basically also updated to support your theme πŸ™‚

          • E.R. Hamilton

            I contacted the developer and am awaiting a response. I am 100% willing to purchase a second theme for you to work on to speed things along. I’m that determined to use their theme and your plugin. Will you agree? Please let me know. Thank you.

          • Let’s see, the developer might be very interested in that integration since the theme is for photographers πŸ™‚ Let me know. Let’s continue our talk through https://meowapps.com/contact/

          • E.R. Hamilton

            The developer has given me permission to forward you my purchased theme to work with. I can forward you the authorization email, or here is the link to the conversation (http://support.imaginemthemes.co/forums/topic/portfolio-photos-meta_key-and-meta_value/#post-44385). The developer is also interested in taking a look at your documentation to see how it works.

            How can I get the theme over to you?

          • Send me an email through https://meowapps.com/contact/ and we will be able to send files to each other after that πŸ™‚ Let’s do it!

  • morgen_m_c

    Hey Jordy,

    Hope you are well. I’ve got a design challenge I’d like to run past you. I’ve been creating a family blog where I post entries with attached photos & galleries, using tags and categories to organise them and surface content in widgets/pages etc. As I take a lot of photos of friends and their kids, I’d like to create a way of grouping all of the photos and their related posts based on the keywords imported from Lightroom people tags. Something like a tag cloud with the keywords (people names) linked to the posts.

    I haven’t got any idea on how I might do this? Can you suggest anything?

    M

    • Hi πŸ™‚ So it’s a bit complicated unfortunately. As you maybe know, WP/LR Sync is syncing to your WordPress/theme/etc, but this architecture you have on the WordPress side (posts, pages, categories, tags) depends on your theme and choice basically. Then WP/LR sync can be set up to work with that architecture.

      So right now, if I understand well, you write posts, with categories, tags, and use the standard WP gallery inside those posts? If yes, that’s simple, you need to set up the Post Types extension shipped with WP/LR Sync: https://meowapps.com/wplr-sync/post-types-extension/

      Lightroom doesn’t recognize the people tags as anything special, they are just tags. So all the tags will go with your media, and will be added to your posts. You can choose them to be exportable or not (each keywords) on Lightroom side, it is part of Lightroom features.

      Then I wouldn’t see any problem with the standard tag cloud neither πŸ™‚

      • morgen_m_c

        Thanks for the quick reply. I think I have the complication of a theme – Voice by Meks (http://mekshq.com/docs/voice-introduction/). Even though I’m using the standard WPGallery, I guess the theme does change things.

        • Sorry for the delay. Indeed, using the Post Types extension is the way to go for that. Keywords a bit tricky, but there were big updates on WP/LR Sync this week, did you update to WP/LR Sync 3, and try to Re-Sync in the Extensions? Maybe also mark all your photos as to be republish, and Publish, that will trigger everything in WP/LR sync. But yes, you would need one gallery / post. What you want, it seems, is the whole Media Library to be browsable, with the keywords from LR as filters. This could be done but it’s a totally different type of work and I would need to work on a gallery system.

          Do you have a website that does exactly what you would like to do? To see an example.

      • morgen_m_c

        Just bumping again Jordy – any thoughts?

  • vmala

    Help please!
    I love the concept and the idea of being able to upload and change the pictures directly from Lightroom, BUT, no matter what I do it doesn’t work after I uploaded all the pictures. When I make a modification to a file and try to publish I get this message in Lightroom.

    Thank you!
    https://uploads.disquscdn.com/images/ca2178cea5281001a3d8142253897b3b98c304a841b59e271d1a5a138812c636.png

  • ⚜️The Agencies ⚜️

    Hi Jordy,

    As soon as I paste the desired meow gallery shortcode with my desired collection ID into a certain post, it immediately says: “No Items Found”, whereas in the Collections & Keywords section, the corresponding ID clearly does contain images. I also tried this with other collection IDs and it all behaves the same. Any ideas what may cause this?

    Many thanks in advance for your thoughts.

    • Hi πŸ™‚ The “No Items Found” is only in the editor, it indeed doesn’t know what will appear in there. Did you try to check this post when it’s published? The content is generated dynamically, not in the post.

      • ⚜️The Agencies ⚜️

        Hi Jordy,

        Ah! That’s a detail that would be useful to know in advance πŸ˜…
        However, unfortunately in my case it also doesn’t show when publishing the page. It just leaves a blank space, as well as an error in my console:

        Failed to load resource: the server responded with a status of 404 (/wp-content/plugins/meow-gallery/css/mgl.css.map)
        I checked my FTP and there is indeed no such file in that folder.

        Also, for what it’s worth: we use only one caching and optimisation plugin, namely WP-Rocket (but disabled all the optimisations for the page I’m testing this on).

        Thanks,
        Les

  • Martin Junius

    Hi, got WP/LR Sync sucessfully up and running. But I can’t figure out how to control the sort order of a gallery insert by [gallery wplr-collection="1"], which is currently something between reservered and random, not reflecting the sort order of the original LR publish collection. WP’s e.g. orderby=”post_date” has no effect. Thanks.

  • greensworld

    I love your plugin and I also bought the real media library plugin as I thought it would sync my LR folders as well from all I could read – but that does not seem to happen – do I need to republish all after the plugin installation??

    • You don’t need to RePublish (even though you could do that) to push the information about your collections to RML. You can try to use the Sync Extensions in the Extensions section of WP/LR Sync (WordPress side). By doing this, RML will receive this info and process it. Can you try and let me know if it works?

      • greensworld

        Hmm – I may have misunderstood the plugin, I get all pictures in, but I get no folder or collection info into the media πŸ™ Do I need to create folders manually?

        • Into the Media? What do you mean by getting the folder or collection info into the Media? Actually, what do you expect? What do you need? Which folders are you talking about? The ones in RML? You didn’t try the “Sync Extensions” button?

          • greensworld

            WP/LR Sync does two more things, a bit less obvious:

            it keeps the hierarchy of folders and collections in its own database in your WordPress, and make it accessible to developers. Therefore, if any plugin or theme wants to get this info, it can.
            it shares with other plugins/themes events about the synchronization. For instance, such events are: a folder is created, a collection is added to it, an image is added (or updated) to a certain collection, another one being deleted, etc. Any other plugin or theme can react based on those events.

            I expected it to, with the Real Media Library plugin, to be able to pick up my folder structure from lightroom as well as any collections I may sync…not a big deal, as the plugin easily transfers my pictures, but that is what I read out of the above info…and this also made me think I would be able to see my folder structure in media..

            Show Folders & Collections in Media Library Enable
            Add a filter in the Media Library to allows selection of a particular collection (also display the hierarchy of folders).

          • WP/LR Sync made it available to developers, but RML doesn’t get it. But there is an extension that you can enable, and that does it. Have a look in the “Extensions”, activate the RML one (I am not talking about the RML plugin, but about the WP/LR Sync Extension for RML which is in the menus), and Sync with the Extensions.

          • greensworld

            I have activated everyting as far as I see it – I hit the re-sync as well. Hmmm – maybe I need to reset as at the very first upload, I did not have the RML plugin enabled – got that after the first load. Will just try that.

            https://uploads.disquscdn.com/images/f41a07dc871faafcee41e3a51e5701c3b21ca4c788376e220c478660c73fdd3b.png

          • greensworld

            So here is where I expected my LR folders and collections to appear πŸ™‚

            https://uploads.disquscdn.com/images/4c79a9ff9d45d1acbaa509e3375823541a8065221751d6faa8008c7fc01c2fb2.png

          • You only need the Extension for RML, not the others, it’s not good to check them if you don’t know what they do. Then after this it should work. What do you have in the screen called “Collections & Keywords”?

          • greensworld

            This is my collection and keywords.

            I have removed all other than RML in extensions.

            https://uploads.disquscdn.com/images/10318d7908e655d510a199030282e156b5f4f880c1e7862dcb3bc01fe087c8d1.png

          • It’s empty πŸ™ Wait, do you have any folders and collections in your WP/LR Sync Publish Service, on the Lightroom side?

          • greensworld

            No – I am not able to drag folders into the sync – there is photos in the sync in LR – do I need to create collections in the sync for it to work? I was wondering how it could figure it out πŸ˜‰

            If I want to delete all my pictures in the sync in LR, expect for the ones I have already used, is there any easy way to do that, or will they dissapear from my WP media library if I empty to sync folder to start over?

          • greensworld

            BINGO – Damn I am slow…so sorry for wasting your time…I will start using Collections and Smart collections in the sync folder πŸ™‚

          • Haha, it’s no problem πŸ™‚ I’m glad it works πŸ™‚

          • greensworld

            At least I think it does – I got the folder in Media, with no images – just waiting for a sync as i think the new images where not synced to start with.

            As far as deleting my first big upload (2100 pictures) where I may have used 50ish of them – will the get deleted from wordpress if I empty the folder – or will the stay in WP because they are linked to a post or page?

          • If you delete images from LR, they will be removed in WP as well, the fact they are linked or not cannot be taken in account unfortunately.

          • greensworld

            Check – Thank you…I just have to be careful then πŸ˜‰

          • greensworld

            YES – pictures are coming over into folders … THANKS again.

  • Hi, I’m using your whole ecosystem now: WP/LR Sync > Meow Gallery > Meow Lightbox. The question I have is about image order. In Lightroom, the collection is sorted by capture time, and the images appear in that order in the Media Library. However, When I insert the gallery into a post [gallery wplr-collection="6"] using Masonry style the images sort differently. Is there a way to fix this? Media gallery image: https://www.screencast.com/t/y1EUv0u7m Post image: https://www.screencast.com/t/HuvA5RLU

    • Hi Mark, do you mind contacting me through meowapps.com/contact? That will be much faster to work with you there πŸ™‚ You can copy/paste your message there.

I recommend you to use WPEngine or SiteGround. They are both excellent hosting services and work perfectly with all my plugins.