Adding A Zenphoto Gallery To Your WordPress

I tend to be a very trigger happy photographer. Whether it is with my own Canon point-and-shoot or with my sister’s borrowed Nikon D100, I love taking a lot of pictures. I also like to share those on the web. I started getting into Flickr sharing but quickly discovered that I wanted to share more images than I was able to on their free service. As a designer and operator of some of my own web sites, I found it more cost effective to host the images myself but desired the simplicity and functionality of a service like Flickr. That’s when I came across Zenphoto.

Zenphoto is a database driven application written in PHP that is built with a clean and customizable backend for managing photo galleries on a web site. Zenphoto allows you to upload images directly from the web interface as well as by FTP. It also is easily customized with themes available to change the public facing side of the gallery. I have built a few different nice looking themes for Zenphoto but until recently, when a visitor to my blog chose to look at my gallery, they would invariably feel as though they transitioned to another web site as the Zenphoto gallery was never a perfect match for the blog.

Finally, I have integrated Zenphoto into my WordPress blog. I have already been enjoying the integration and have plans for many other improvements with how they work together, but I thought I’d share what I’ve done thus far for anyone interested.

My ZenPhoto Gallery

Here is where I got the files and a place to start from. He does a very good job simplifying things.  http://tech.einaregilsson.com/2007/08/06/integrating-zenphoto-into-wordpress/

To follow some of this, a little understanding of PHP may be required.

Copy the wordpress-integration-zp-theme folder into your zenphoto/themes folder and then in Zenphoto choose Options and activate the theme called ‘WordPress Integration Theme’.

Copy the files (zp-index.php, zp-image.php, zp-album.php, zp-style.css) from the wordpress-theme-files folder into your current WordPress theme folder, /wp-content/themes/yourthemename. You’ll see the files now when you go to edit your theme from within WordPress.

Your installation of Zenphoto should be within the WordPress folder on your server. ( yoursite.com/zenphoto/ ) When you get the zen-integration.php file from the link I listed above, put it in the plugins folder and activated it in WordPress, it will install a link to your Zenphoto into the management panel. From this point, some PHP and template alterations will be required from your WordPress theme editor to make it look the way you want it to. Basically, at this point, Zenphoto should be displaying in the content area on your photo page.

To this point I haven’t completely integrated the Zenphoto management into the WordPress template so when you use the link to the Zenphoto management console, you essentially leave WordPress. So to improve flow, I added a link back to the WordPress management page.

To do this, you just have to create the link in zp-core/admin-functions.php. In the function printLogoAndLinks(), I inserted “| &nbsp; <a href=\”/wp-admin/\”>”.gettext(“WordPress”).”</a> &nbsp;”.

Please let me know if you’ve got any questions or suggestions.

About Paul Cushing

Paul is primarily an electrician in Boise, Idaho for TriState Electric. After his daily electrical work however, he pores over new web design technology and continually pushes himself to stay creative with the latest techniques and style. He is proficient in HTML, CSS, Javascript, jQuery, PHP, MySQL, most Adobe software, and has dabbled with Flash and Actionscript. Paul never runs out of creativity. He loves to be expressive through, drawing, acrylic painting, photography, music, graphic design.
This entry was posted in Wordpress, Zenphoto and tagged , , , , , , . Bookmark the permalink.

5 Responses to Adding A Zenphoto Gallery To Your WordPress

  1. Hi,
    I follow the steps. Almost everything is ok, except:
    a) the link between WP admin and ZP admin does not work (says: “Cannot load “.

    b) the ZP admin does not have the options tab anymore, and I cant log out because the password field in the login form has been changend by a capcha, and when you enter the capcha, it says a request was sent (dont know where, not to my email)…
    Any ideias? thanks
    My site http://www.barrento.com/wordpress/

  2. …one more thing: the integration is not complete, I have to change the way ZP part is shown now, and, for exemple, the comment form does not work anymore…

  3. eric says:

    installed newest version of zenphoto and the plugin file had to be modified

    add_menu_page(‘ZenPhoto’, ‘ZenPhoto’, 1, “../$name/zen/admin.php”);

    to

    add_menu_page(‘ZenPhoto’, ‘ZenPhoto’, 1, “../$name/zp-core/admin.php”);

  4. Paul Cushing says:

    That’s right eric. I forgot about that little part. The plugin was based on past versions of zenphoto and assumed the base directory would be at “zen”. I don’t recall what version changed the base directory, but for the most recent versions you’ll need to modify the plugin as eric has mentioned by changing the link to zenphoto’s admin area from
    ../$name/zen/admin.php
    to
    ../$name/zp-core/admin.php

    Thanks eric

  5. Zephyr says:

    I did as instructed, but as mentioned by a previous poster, the link between WP and Zenphoto control panel is broken (cannot load.)

    I changed the add_menu_page(‘ZenPhoto’, ‘ZenPhoto’, 1, “../$name/zen/admin.php”);

    to

    add_menu_page(‘ZenPhoto’, ‘ZenPhoto’, 1, “../$name/zp-core/admin.php”);

    What am I missing?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>