Integration:WPG2 FAQ - Gallery Codex
Personal tools

Integration:WPG2 FAQ

From Gallery Codex

Q: Help! Fatal error: Call to a member function on a non-object in gallery/modules/rewrite/classes/RewriteApi.class

  • If you are getting this error during WPG2 and if you have installed Gallery2 via the Fantastico script then you need to deactivate (you may have to activate the module first) the g2 rewrite module via Gallery2 Site Admin Panel. Unfortunately the Fantastico installation script leaves the Gallery2 rewrite module in a partly activated state thus causing this error.

Q: How come the WPG2 Output page just returns blank?

  • Most common cause of this problem is you do not have enough php memory allocated. Gallery2 requires at least 16MB (*and maybe more) to run. You can increase the memory allocation by adding the following line to your .htaccess in your wordpress directory:
phpvalue memorylimit 32M
  • On some server configurations, 32M is not sufficient. If you continue to get blank pages, keep raising the limit until it works. Some configurations have required memory limits as high as 48M and even 64M.

Q: How can I change the URL of the embedded WPG2 page?

  • You can change the URL by changing the "Page Slug" under Manage -> Pages -> Edit for the embedded page. You can also change the "Page Title" while you're there, if you like.
  • If you have Gallery2 Template Caching turned on you will need to flush your Gallery2 Template Cache to force the G2 to regenerate its links, you can do this via the Gallery2 Site Admin -> Maintenance Menu -> Delete Template Cache.

Q: How can I redirect my old wp-gallery2.php to my new location?

  • If you would like to redirect your old wp-gallery2.php links to your new embedded page, add the following at the top of your WordPress-generated .htaccess file:
Redirect 301 /wp-gallery2.php http://www.yourdomain.com/wpg2

Q: How come I am "Guest" when viewing my Gallery2 Page via WPG2?

Firstly check to ensure your Wordpress User has a Gallery2 Account by navigating the WPG2 Gallery2 Users Tab. If your Wordpress user has an account, then the "guest" issue is commonly caused by a conflict between a still logged in Gallery2 Standalone Session (for the same user). Navigate to your Standalone Gallery2 and log the same user and out of the Standalone Gallery2. If this fails try clearing your cookies.

Q: How do I remove the $g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT from my embedded gallery links?

In Gallery2 -> Site Admin -> General Settings (the first page on Site Admin), go to the "Cookies" section towards the bottom, and enter a slash ( / ) in the "Path" box. This will force the cookies to play better between WP and G2 and will eliminate the g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT from your embedded G2 links.

If you click the + button next to "Cookies," you'll get a longer explanation. Make sure you pay attention to the final note:

Once you change the cookie settings, all registered users of your Gallery
will have to clear their browser cookie cache. If they do not, they will
experience login / logout / lost session problems.

Q: Why does the embedded Gallery2 sometimes seem to forget who the authenticated user is?

In Gallery2 -> Site Admin -> General Settings (the first page on Site Admin), go to the "Cookies" section towards the bottom, and enter a slash ( / ) in the "Path" box. This will force the cookies to play better between WP and G2 and will eliminate the g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT from your embedded G2 links.

If you click the + button next to "Cookies," you'll get a longer explanation. Make sure you pay attention to the final note:

Once you change the cookie settings, all registered users of your Gallery
will have to clear their browser cookie cache. If they do not, they will
experience login / logout / lost session problems.

Q:How come my font Size in Gallery2 is so small?

Edit your Gallery2 Theme stylesheet (gallery2/theme/themename/theme.css) and look for the following

  1. gallery {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 62.5%; <--- Increase / Adjust This..
  color: #333;
  background-color: #fff;

}

Q:How Come my Lightbox is only showing Fullsized Photos?

Ensure the minimum image lightbox height you have specified in the WPG2 lightbox options is at least equal to the size of your resized image in Gallery2. Remember Gallery2 resizes an image keeping its aspect ratio (width * Length) thus, although you may have specified a resized image of 800px in reality's your images could be larger or smaller (and most likely will be).

Also Note: Resized images are only created when the image is first viewed, you can force generate / build all thumbnails and resizes of the whole Gallery2 by browsing to Site Admin -> Maintenance -> Build all thumbnails/resizes, or instead build the resized images for a specific album by editing the applicable album and in the Album Tab and selecting Build resizes too under the Apply settings to existing items.

Q:How come the WPG2 is not creating Users?

From Wordpress 2.0 security evolved to a new concept called "roles". Each role has a certain capacities to run WP activites.

With the WPG2 plugin, in order for a Wordpress user to have a matching Gallery2 user ID the (Wordpress) role the Wordpress user is assigned to, must also have a (G2 user) capabilities or (G2 Admin) if you want them to have administrator rights).

Once you assign the (G2 User) capabilities to any user or Wordpress role the WPG2 plugin will then automatically create the Gallery2 user for you..

By default only (administrator, contributor, author & editor) roles will create Gallery2 users, however you can manually assign these capabilities to other roles (or users) via the Wordpress user admin or better still use the excellent Role Manager plugin

Q: Gallery2 to WPG2 Relative Path Validate? - [Failure]

If WPG2 validation is failing with Gallery2 to WPG2 Relative Path Validate? - [Failure] and you did not deactivate the WPG2 plugin prior to upgrading from an older release then please deactivate the WPG2 plugin and reactivate it.. If you continue to have problems then the value will be the path from your Gallery2 ROOT directory back to your WPG2 plugin (usually would be something like the examples below). You can maintain this value in the WPG2 Paths tab..

../wordpress/wp-content/plugins/wpg2
../wp-content/plugins/wpg2
../blog/wp-content/plugins/wpg2

Q: How to activate the WPG2 Debug Logging?

WPG2 3.05+ will generate DEBUG messages from's it's various function calls. These messages can be displayed with the excellent BTEV Wordpress Plugin and can be used to help debug unusual behaviour. Please read the BTEV webpage for more information