WPG2 - WordPress / Gallery2 Integration

Version 2.0
Authors: WPG2 Development Team
Online Documentation: wpg2.galleryembedded.com
Support Forum: www.galleryembedded.com


  1. To use the "WPG2" plugin, you must have Gallery2 installed and properly configured:
    • You must have Gallery2 2.1
    • NOTE: This version WILL NOT WORK with Gallery2 version 2.0.x.
      • Use WPG2 version 1.0 with G2Image version 1.3.5 if you need to use Gallery2 version 2.0.x.
      • If you are using Gallery2 2.0.x, we highly recommend that you upgrade to Gallery2 2.1 and WPG2 2.0 because of Gallery2's greatly improved performance and WPG2's automated setup.
    • You must also have the Gallery2 ImageBlock and ImageFrame modules installed and activated.
      • The ImageBlock and ImageFrame modules do not come with the "minimum" Gallery2 installation and must be downloaded from the Gallery2 download page and installed separately.
  2. You must also have WordPress installed and properly configured:
  3. Wordpress & Gallery2 may be on different subdomains.
  4. Wordpress & Gallery2 should be installed on the same Database.
  5. Only one WordPress Blog tied to one Gallery2 Gallery
    • Unless you only have one identical user on multiple blogs, tying multiple blogs to one gallery will cause user errors because there is not a way to currently distinguish one blog's users from another blog's users within Gallery2.
  6. PHP memory limit of 16MB or better.
  7. Tested with IE 6.0 and Firefox 1.5.



File Installation

  1. Unzip the files.
  2. FTP the file "wp-gallery2.php" to your WordPress root directory. This is the directory that contains wp-config.php. Under a default WordPress installation it is /wordpress/.
  3. FTP the contents of the "wp-content/plugins/wpg2/" directory to a new folder called /wpg2/ in your WordPress plugins directory, /wordpress/wp-content/plugins/.
  4. FTP the contents of the "wp-includes/js/tinymce/plugins/g2image/" directory to a new folder called /g2image/ in your TinyMCE plugins directory, /wordpress/wp-includes/js/tinymce/plugins/.
  5. After everything is installed, force a reload (for FireFox) or a refresh (for IE) at the "Write Post" and/or "Write Page" admin pages. This forces the TinyMCE javascript to reload and display the button.
  6. See Configuration, below, for activating and configuring the plugin.

More TinyMCE Considerations

CSS for the alignment options

Language Support


Activate WPG2

Validate WPG2

Verify User Account Setup


  1. Images in blog posts: Use the G2Image popup by clicking the "G2Image" button (if using TinyMCE, the rich-text editor) or the "WPG2" quicktag. <wpg2id> tags provide the most flexibility because they will work if you move your images and/or albums around within the Gallery2 album structure.
  2. Single images in the sidebar - Use the following code:
    <?php print g2_sidebarimageblock(); ?>
    This will create a sidebar image block per the settings on the WPG2 Sidebar Options tab.
  3. Sidebar grids (multiple images of one type):
    • Use the following code:
      <?php print g2_sidebargridblock(); ?>
      This will create a sidebar image gridblock per the settings on the WPG2 Sidebar Block Options tab.
    • You can also use the following code:
      <?php print g2_sidebargridblock('blocktype', number_of_images, blockmaximgsize, 'blocktitle'); ?>
      This will create a sidebar image gridblock using the parameters defined in the fuction call, if present. If a given parameter is not included in the function call, the settings from the WPG2 Sidebar Block Options tab will be used for that parameter.
      • Valid options for 'blocktype' are
        • 'randomImage'
        • 'recentImage'
        • 'randomAlbum'
        • 'recentAlbum'
      • number_of_images is an integer that defines the number of images that will be included in this particular image gridblock.
      • blockmaximgsize is an integer that defines the maximimum number of pixels that a thumbnail will occupy in either width or height. This can be larger than the pixel size of your Gallery2 thumbnails, but it will not increase the size of the thumbnail in this case.
      • 'blocktitle' is the title that you want shown as a <h2> heading in the image gridblock.
  4. See the online documentation and the WPG2 support forum for more information.


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details, in the LICENSE.HTML file.

If you have not received a copy of this file along with this program, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307