Sync with a Page (or Post Type)

This article is difficult to properly name but basically you are here because you would like to sync your collection of photos in Lightroom with a certain kind of page on your website. This kind of page should be called a post-type. A post-type can be a portfolio, a post, a page, 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.

What WP/LR Sync does

WP/LR Sync sends and keeps your photos updated with the Media Library. This is its main function.

WP/LR Sync does two more things, less obvious to the users:

  • it shares with other plugins/themes the events about the synchronization. For instance such events as a folder being created, a collection being added to it, an image being added (or updated) to a certain collection, another one being deleted, etc.
  • it keeps the hierarchy of folders and collections in its own database in your WordPress, and make it accessible to any plugin or theme that wants to use it.

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 about the subject here.

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.

Then, what can you do? 🙂

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.

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:
            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:

          • 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

          • 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 ( 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 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?


    • 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:

      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 ( Even though I’m using the standard WPGallery, I guess the theme does change things.

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