Embedding Piwigo galleries into a WordPress page

We’ve been looking for a new gallery solution for some of our sites and Piwigo looks to have most of the features we are looking for. The unfortunate part is Piwigo is not designed to be embedded. I want to embed the gallery into a page so I can use my WordPress theme to insert the header and footer. It will mean less upkeep as I adjust my WordPress theme, I won’t have to update my Piwigo theme as well.

Piwigo is not designed to be embedded. To get around the problem, I have attempted two different solutions. First was a shortcode. The second method was a custom page template. Both solutions do essentially the same thing. They make a request of Piwigo, get the response back, change the URLs for links, form actions and images, and send the results to the screen. At the moment, both solutions have the same two problems. The title of the page does not reflect where you are in the gallery and logging in does not work.

The title problem is fixable on the template but not on the shortcode, at least not so search engine crawlers can index the images. The problem with logging in is one I’m still working on. Also of note here is that I am currently using some of the standard themes with Piwigo. To make either of these solutions work well, I should create a custom theme that doesn’t output the HTML head section or any header or footer for the page. That’s on the to-do list.

For the logging in problem, I thought the problem was related to cookies. It might still be, but in both cases I have forwarded on the cookies Piwigo sets. It may also have to do with how Piwigo does a redirect after logging in. I need to look into this further.

With any luck, I’ll get these problems fixed. Once I do, I will release the solution for others to use. If anyone is interested in the solution as it is now, let me know. Logging in through the WordPress page doesn’t work, but you can go direct to the Piwigo install to log in. More details to follow.

Published by

Dan

Been a programmer, primarily in the internet space, since late 1997. Google+ Profile

9 thoughts on “Embedding Piwigo galleries into a WordPress page”

  1. When I left this, I had the embedding working ok, but logins wouldn’t work. I never got the cookies to transfer correctly. This made the system as a whole not usable for our purposes. I haven’t gone back to it recently, but should get a chance soon.

    1. I looked at the Piwigopress plugin when I first looked into this. It didn’t have the functionality I was looking for. It allows you to add Piwigo images to your sidebar as a widget and I think it also facilitates you adding images from Piwigo into your stories. What I wanted was the Piwigo gallery skinned by the WordPress skin and to sit within a WordPress page.

  2. Hi,

    currently I use NextGen-Gallery but would love to switch to Piwigo instead, so I would be interested in your solution and would be able to do some testing if you like!?

    Cheers
    Yogie

    1. I have refined my approach a bit since I wrote this and can probably provide some code in a bit. I’ll have to double check where I’d left it, but I think I got logging in working in the end.

    1. I had a look at your Piwigo page in the link, Stefan – that one does not seem to have gone very far. Are there other, later examples?

Comments are closed.