• Resolved Arjun Singh

    (@xylocone)


    [This is a developer problem. I hope this is the right place to ask]

    I have created a WordPress theme. While developing this theme, it was hosted locally on my computer using Local by Flywheel. When I exported the WordPress data for my demo, in the exported demo-content.xml file, all the attachments had a local url, which of course will be a problem when I distribute my theme.

    A naive solution that I thought of was to host my images on Github and replace all attachment URLs in demo-content.xml to point to the ones hosted on Github; but I ran into a problem: there a lot of attachments in there that I had not uploaded but got uploaded automatically (such as Elementor’s ‘screenshot’ images, WordPress’ cropped versions of my uploads etc.)

    What do I do then? While writing this, I have another idea: to host the entire uploads directory onto Github and then referencing it in my demo-content.xml; but, I guess, before I go about trying that, I should better check out what the standard way of doing this is.

    So, what’s the standard way of dealing with attachment URLs when you have exported WordPress data locally? (Are you even supposed to export the data locally? If not, that would be sad because then I would have to keep a website up and running all the time for my demo to be usable…)

    I will highly appreciate any help you throw my way!

    • This topic was modified 2 years, 2 months ago by Arjun Singh.
Viewing 1 replies (of 1 total)
  • Plugin Author Gregor Capuder

    (@capuderg)

    Hi @xylocone,

    yes, you should have a live hosted demo site of your theme, from which you should create the export XML file. This way all the images will be available to your clients when they import the content.

    That’s how all other theme authors are doing it.

    You could also be able to replace the local images with images hosted somewhere else, but we don’t have any experience with that, since we always did it as I mentioned above.

    Take care!

Viewing 1 replies (of 1 total)
  • The topic ‘How do locally exported attachments work with OCDI?’ is closed to new replies.