Integrating Plogger into WordPress
My PloggerPress plugin has been quite a popular download for WordPress users looking to incorporate an image gallery into their blog. However, to integrate the whole of Plogger into your blog’s theme as I have done (GALLERY) is not all that straightforward. Until recently David Perality’s instructions on the subject covered this. So due to popular demand and the mysterious disappearance of David’s original post, here is my guide to this piece of blog trickery…
Getting started
The main idea is that you can’t just call the plogger code from within your theme. You actually have to make the plogger index.php look like your theme, by calling the appropriate WordPress template tags from the plogger index file.
Step 1
Open the index.php file found in your Plogger’s installation folder.
Index.php is actually a very simple file, there are only a few lines of code in it.
The only three lines of code that you need to run Plogger are:
require("gallery.php");
the_gallery_head();
the_gallery();
You will need to keep these three lines of code handy.
Step 2
You now need to create a new index.php file. (It is worth making a backup of the old one frist though!). The new version will be made to look like your theme starting with the page.php file from the WordPress theme you are using.
Find your page.php file. Make a copy of it called index.php and open it.
Step 3
Add <?php require('../wp-blog-header.php'); as the very first line of code to the file. The index file will end up in your plogger folder. This line locates the WordPress code. The path shown here assumes your plogger directory is in a subfolder on your site and WordPress is installed in the root. If it isn’t you will obviously need to change this path.
Immediately after, on the second line you need to add the Plogger code:
<?php require("gallery.php"); ?>
Now remove everything inside the main content div tags and replace it with just:
<?php the_gallery_head(); ?>
<?php the_gallery(); ?>
The finished file should look something like:
<?php require('../wp-blog-header.php');
require("gallery.php"); ?>
<?php get_header(); ?>
<div class="content">
<?php the_gallery_head(); ?>
<?php the_gallery(); ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Step 4
Save the file as index.php and copy it to the folder where you installed Plogger.
Step 5
Test it and tweak it – you are done!
Step 6 (optional)
Put a link to your gallery on your blog either by editing the theme sidebar code or use redirectify to point a page to the Plogger index.php file.
Step 7
Leave a comment here and tell Tim what he forgot to tell you!
It isn’t easy or elegant but it works!














Thanks Tim – this has worked out perfectly at sista@sista.co.za. The only thing you left out of your instructions is to make sure that plogger is installed into the same database as wordpress – and the default table prefix is “_plogger”. Also, I had to uncomment the display:inline for the forms (in plogger/css/gallery.css) because it messed up my layout.
Thanks for the help!
oops – the above url should be http://www.sista2sista.co.za/gallery
[...] rechts ist der Link dazu zu finden (”Gallery”). Zurechtgetüddelt ist das mit Plogger, dieser Anleitung und dem [...]
I do like very much what you have created for photos in wordpress. Thank you! I get a fatal error message when I follow the steps above to integrate Plogger with my theme.
“Fatal error: Cannot redeclare getmicrotime() (previously declared in /home/.oba/bgbc/bellgardensbaptist.org/wp-content/plugins/ podpress/podpress_functions.php:89) in /home/.oba/bgbc/bellgardensbaptist.org/gallery/gallery.php on line 1064″
When I deactivate the plugin (podpress) that appears to cause the conflict, Plogger appears and works as it should. Is there a work-around, or maybe something I a missing?
Looks like podpress and plogger are using the same code libraries, though I haven’t come across this on my site where I have plogger and podpress running.
When you create the index file for plogger you need to leave out any parts of the theme that use podpress.
I had a similar problem with another plugin. So I ended up with different versions of the sidebar just for the plogger page.
Great man You have solved My problem. I got Installed ploggerpress and also embeded plogger Into my wordpress blog http://www.bellntell.com/photo-gallery/ Its working well
Thanks Again
http://needlessproductions.com/photos
I tried this out… here is the error I get:
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/neededm4/public_html/photos/index.php:1) in /home/neededm4/public_html/photos/plog-globals.php on line 5
Warning: Cannot modify header information – headers already sent by (output started at /home/neededm4/public_html/photos/index.php:1) in /home/neededm4/public_html/photos/plog-load_config.php on line 26
Maybe you could help me out with this, Tim.
This kind of error is often something as silly as a blank line at the end of a file in a plugin or theme. Other than that I can only suggest going back to the basic index page and adding a bit at a time until you find what causes the problem.
[...] to Tim over at LivingOpenSource, I was able to do just that with ease. I even used his plogger-press plugin instead of my latest [...]
[...] After Trying (took one week) many many Photogallery Plugins , Finally One New Idea came from livingos.com , Thanks …. about plogger Photogallery Script Now , see it in Action, without out [...]
Hey… DOES this have to be installed in the same database, like Roger Saner said above? I’m going to be doing this with my wordpress as I install plogger, and I’d really like to get it right the first time around.
Great article! Has been bookmarked.
Yes. For the plugin to work you must have plogger and wordpress in the same MySQL database.
Minor tweak I made: you can get Plogger’s stylesheet and Javascript into the <head> of the page like this:
<?php
require(‘../wp-blog-header.php’);
require(‘gallery.php’);
add_action(‘wp_head’, ‘the_gallery_head’);
get_header();
?>
<?php the_gallery(); ?>
<?php
get_footer();
?>
Gah, I love your idea and I was so excited to make this change.
Of course – with my usual luck I just get a blank page
My WP is installet in /wp/ and my plogger in /foto/ so this is the code I have in my plogger index.php:
I have Plogger 3 and WordPress 2.2, could that be the problem?
They are both in the same database with the prefix plogger_ and wp_
Ah! I hadn’t realised that Plogger 3 had been released. It has been in Beta a while, so haven’t bothered with it yet.
Theses notes are for Plogger 2. When i get a quiet evening, I’ll try and take a look at Plogger 3.
I figured I’d be screwed. Maybe I should install Plogger 2
I hope you get a chance to look at it.
Thanks a bunch for this great site.
Hi,
I’ve just installed the plugin on plogger 3 – embedding albums (almost) works, but the URL to the image source has changed and so I get a 404 when I try to open the image from worpdress. For example:
The path to the image coming from wordpress:
$Siteurl/plogger/index.phpimages/album/category/picture.jpg
The real path where the Image resides:
$siteurl/plogger/index/album/category/picture.jpg
I’m not that good in php I haven’t figured out where this wrong path is inserted.
Thanks,
Thanks for some great info
[...] Integrating Plogger Integrating Plogger into WordPress [...]
Thanks alot, Tim!
I started looking for a way to put my niece’s pictures online a while back and I found Plogger. Then I wanted to blog and I found WordPress. Thank you very much for linking the two together.
[...] http://www.livingos.com/2007/02/26/integrating-plogger-into-wordpress/ [...]
Hello guys
Wasjust serfing on net and found this site…want to say thanks. Great site and content!
Hi Tim, thanks for the lovely post. Everything worked for me for plogger Version 1.0-RC1 and Word press 3.0 . One typo that i noticed and messed up my formatting was div class=”content” part. Correction: It needs to be corrected to div id=”content” for working with the plogger theme style