Gallery Plugin

This is a worpress plugin that integrates gallery into wordpress. right now it can do two things:

  1. display a random image from you gallery in the side bar
  2. display an album within a blog post (example): shows the first image of an album, the user can browse through the images via next/previous links, which load the other images using AJAX

download: wp-gallery-plugin_0.1.1.zip

installation

  • to use this plugin you need to have wordpress 2 and gallery 1.x installed on the same machine, right now i have only tested this under debian
  • unpack the archive into your wordpress plugins directory wordpress/wp_content/plugins
  • edit gallery/gallery_lib.php - enter the following values:
    • $gallery_dir - the local diretory where your gallery albums are diplayed
    • $pictures_url - the URL where the gallery pictures are available at
    • $albums_url - the URL where the albums are available at
    • $exclude_dirs (optional) - an array with directory names (no absolute path names) that should be excluded for the sidebar random image display
  • activate the plugin in the admin section

display random image in sidebar

  • edit your sidebar php file, for the wordpress 2 standard theme, this is wp_content/themes/default/sidebar.php
  • insert <?php random_gallery_thumb(); ?> where you want the random image to appear

display album in blog post

  • create a post
  • enter {album: ‘name’} where you want the album to appear, where name ist the name of the album as it appears in the gallery URL (leave out the quotes)

questions? problems? email me at me[at]langalex[dot]org

version history

  • 0.1.1 bugfix, album viewer always used thumbnails instead of scaled images
  • 0.1 - initial release

Tags: