Features

  • enable simple building of image galleries (it not uses built in media support) – it’s targeted for sites where is WordPress used as a CMS
  • Plugin's second widgetcontains two widgets – one with the list of available galleries and second with images from the selected (or latest) gallery – this widget is aimed for the main page of blog on which is used
  • you can create galleries by two ways: using plugin’s own upload wizard or your favourite FTP client. If you use plugin’s wizard images will be automatically resized.
  • offers English and Czech locales

TODOs

  • enable automatic resizing also for images uploaded via user’s FTP client not by plugin’s wizard
  • Galleries list widget 2add another widget with small thumbnails of the first images of galleries – something like this:
  • enable adding galleries directly to the posts/pages through the new button in WYSIWYG editor
  • enable using of galleries from your Google Picasa (and maybe also Flickr or others if some client want it) account as same as these which are stored directly on your server
  • enable append WP tags or categories to the galleries

Screenshots

Galleries main admin page 'Add gallery' page Options page

How to display photogallery page

  1. in WP admin create new page, enter title you want and into the post’s body insert only this text: [photogallery_page]
  2. insert ID of newly created page into the plugin’s options
  3. place this code into the file functions.php in folder of your current theme:
    <?php
    /* Custom content filter */
    function my_content_filter($content) {
      global $od_photogallery_plugin;
      
      if(strpos($content, '<p>[photogallery_page]</p>') !== false) {
        // If you want to display only certain gallery you can simply insert 
        // uncoment line below:
        //$gallery_page = $od_photogallery_plugin->render_public_gallery(1);
        
        // Or here is simple solution how display selected gallery - that can be 
        // performed through the gallery widget:
        $gallery_ID  = (isset($_GET['gallery_ID'])) ? (int) $_GET['gallery_ID'] : 1;
        $gallery_page = $od_photogallery_plugin->render_public_gallery($gallery_ID); 
        
        return str_replace('<p>[photogallery_page]</p>', $gallery_page, $content);
      }
    ?>

This will lead that on the page you’ve created before will be displayed selected galleries.

Styling gallery

As you can see on test gallery there is also need of additional styles and JavaScript. For the same look follow these steps:

  1. upload to your theme’s directory MooTools and LightBox. In my case this include these files:
      img/loading.gif
      img/nextlabel.gif
      img/prevlabel.gif
      js/mootools.js
      js/slimbox.js
      slimbox.css
  2. update header.php file with these lines:
    <script src="<?php bloginfo('stylesheet_directory');?>/js/mootools.js" 
            type="text/javascript"/>
    <script src="<?php bloginfo('stylesheet_directory');?>/js/slimbox.js" 
            type="text/javascript"/>
  3. update style.css, for example:
    /*
    CSS styles for photogallery
    */
    div.fotogalerie {}
    div.fotogalerie h2 {}
    div.fotogalerie h3 {}
    
    /* photo rows container */
    div.fotogalerie .fotky {
      text-align: center;
      width: 100%;
    }
    /* photo row */
    div.fotogalerie .fotky .fotka {
      width: 110px;
      min-width: 110px;
      height: 130px;
      text-align: center;
      float: left;
      border: 1px solid #ccc;
      background-color: #f2f2f2;
      margin: 5px 5px 5px 5px;
      padding: 5px 5px 2px 5px;
      font-size: 90%;
    }

And this is all…

Subpages