G4B Photo Gallery Plugin For Wordpress
G4B Photo Gallery is a free, flexible plugin for Wordpress. It provides a simple and effective way to include a complete gallery anywhere on your site, just by typing in a keyword.
Live Demo
Admin Screenshots
Some screenshots of G4B Gallery admin pages.
Cars
An example gallery with some cars.
Landscapes
No photo gallery would be complete without landscapes.
Features
- Supports Wordpress 2.2 - 2.6.2
- Supports PHP 4 and 5
- Supports JPEG, GIF and PNG file types
- Easily adjust thumbnail and photo size in settings page
- Crop photos or size proportionally
- Easily customizable with CSS
Plugin Installation
The installation procedure is similar to most other Wordpress plugins. Unzip the file and upload its contents to your Wordpress plugin directory. Make sure you keep the directory structure intact. Once uploaded the files should be located at:
/wp-content/plugins/G4B_gallery/[php_files_here].
In order to upload photos, your upload directory MUST BE WRITABLE. When installed, the plugin will automatically create a directory within your plugin directory for storing uploaded photos. The default location is:
/wp-content/uploads/g4b_gallery
Usage
To include your photo gallery on any page or post, type in the keyword:
{g4b_gallery}
When the content is loaded, the plugin looks for this keyword, and swaps it with the photo gallery dynamically. To remove the gallery from that page or post, simply remove the keyword.
If you would like to embed the plugin using PHP, call the function:
echo G4B_gallery_view();
The function does not have to be within the Wordpress loop.
Styling with CSS
Style your gallery easily by editing the CSS file. The CSS file is located at:
/wp-content/plugins/G4B_gallery/G4B_gallery_view.css
Bugs & Suggestions
If you run into any bugs or have some suggestions, please post them in the comments. That way others can see if the same issue has already been submitted. Thanks!
9.27.2008
Hi Gavin,
This looks like an awesome plugin. Thanks for making it available for free! That’s so generous.
I just have a question- when you embed the gallery using {g4b_gallery} can you pick which gallery you embed?
In your example, could I embed only the “cars” gallery on a page, or would it embed all three galleries simultaneously?
Also, do you have your email address on this blog? I don’t see it.
Thanks so much!
&au!a3
9.28.2008
Hey, glad you like the plugin. Right now the only option is to embed all albums.
I’m currently working on version 1.1 which will have the option of defining the galleries you want to display. It will look something like this:
{g4b_gallery album=”cars”}
There will also be the option to show photos directly in an album, instead of showing the album itself first. That option will look like this:
{g4b_gallery album=”cars” photos=”true”}
As far as my email address goes, no I don’t have it available on the site. Reason is to avoid spam. :)
9.30.2008
Hi, I tryed to use the plugin and failed.
I wonder what I’m doing wrong?
I followed the intructions: 2. Make sure that the folder wp-content/uploads/ exists and is writable by the server (CHMOD 755)
Is it really “uploads”? or is it upload. I’ve tried both. I’ve even tried to create folders in different locations.
Some days I feel confused.
DW
9.30.2008
After I posted the comment above, everything worked as it should. Thanks,
DW
9.30.2008
Nice plugin!
I would add to the wish list option to describe each photo and album and display those descriptions. Thank you!
9.30.2008
Glad you got it working DW. Do you mind posting what the initial issue was? That way others can see? Thanks.
Marijus, the Albums and Photos both have title and descriptions, and are displayed in all 3 area’s (albums view, photos view and single photo view). The only reason you don’t see them in my example above, is because I’ve hidden them with CSS. If you look at the source, you’ll be able to see them.
9.30.2008
G4B Photo Gallery Plugin For Wordpress…
G4B Photo Gallery is a free, flexible plugin for Wordpress. It provides a simple and effective way to include a complete gallery anywhere on your site, just by typing in a keyword….
10.01.2008
One quick question. Could there be an option to show images that’s hosted on other sites such as imageshack or whathaveu? I would like to be able to input the URL of the image and make it show in the gallery.
Also, support for Shadowbox would be helpful.
10.01.2008
Dear Sir,
Thank you for offering this great plug in ! But, after followed all the instuctions, when I went to admin and click on the G4B Gallery icon the below error showing. Can you please tell me what I should adjust ? Thank you !
The requested URL /news/wp-admin/G4B_gallery/G4B_gallery_manage.php was not found on this server.
10.01.2008
James,
At this point, I’m not planning to allow external sources. There are tons of plugins that already do a great job of this. G4B Photo Gallery was created to be a stand-alone gallery tool.
White Chen,
This could be one of two problems. Either you’ve changed the default location for your plugins, or you didn’t upload the plugin to the correct directory.
Have you made any changes to the default directory layout in Wordpress? Or is it a default install? What path did you upload the plugin to?
10.01.2008
Dear Sir,
Thank you for giving the promptly response.
First, I didn’t make any change to the default directory. The only thing I have done since install was upload new themes, a photoq plugin and your plugin. That’s all.
I have no problem to use photoq.
I do notice that there is an “uploads” file existed. Will it effect the usage for g4b ?
Thank you very much for paying attention. I will keep to work on it.
10.07.2008
Hello,
I like the plugin very much, is there any chance to implement some SEO functions to it? It would be nice to have clean static urls when opening new albums.
Thank you
10.07.2008
Hey Silvestre,
I haven’t started on the different URL types, but it is something I’ve looked at. The only problem is the user may or may not be using custom permalinks on their Wordpress installation.
Maybe an option in the gallery settings could enable or disable “pretty urls”.
I’ll add this to the 1.2 release. Currently working on 1.1.
Thanks for the comment.
10.10.2008
I just downloaded your plugin. I am having problems uploading files. Everytime I try to load a .jpg file it says that I have an invalid file type. Any suggestions?
10.20.2008
Nice, but not yet useful for serious uploads since the plugin lacks a way to handle and upload larger amount of images and also some tags like alt-tag + title-tag if i remember it correctly? Also it lacks ability to crop to square thumbnail which of course is a bit annoying.
I just tried it quickly. Nice going though - there is a great lack of galleries that would be simple to use for more novice people (like my clients - always need to help them update their Nextgen Galleries since it’s so bloated…). I’ll have to stay up to date with your gallery. :)
Regards,
Tommie Hansen
10.20.2008
Hi,
I had the same problem as White Chen. It’s seems that the zip file decompress in a diferent folder: g4b-photo-gallery, and the wordpress look for a different route.
The solution: rename the plugin folder to G4B_gallery.
Great works, thankyou!
10.20.2008
Javier,
Ah, ok. I see whats happening. When you unzip its putting the plugin folder inside the g4b-photo-gallery folder.
Its important that you only upload the “G4B_Gallery” folder.
Thanks for the feedback Javier!
gusleonard,
It seems the way I’m checking for a valid file formats isn’t the best solution. I’m working on a better method for determining file extensions on v1.1.
10.21.2008
@ White Chen: Did you rename the G4B plugin folder? When you unzip the plugin, it creates a folder called g4b-photo-gallery, but the code directs WordPress to look for a folder called G4B_gallery. So if you just upload the directory without renaming it, you will get an error when you try to use the plugin. (I learned this the hard way!)
Gavin - nice plugin. Hopefully in the next version you will fix the directory name so it matches. Also it would be nice if you showed the post dates in your comments! I look forward to future versions.
10.21.2008
Tried v1.0 from your download link, it’s activated, but unable to access the option page. the link shows up as http://domain/path/wp-admin/GB4_gallery/GB4_gallery_options.php.
I’m using wp 2.6.2. Please help. Thanks.
10.21.2008
BrightBold,
Glad you like the plugin. Version 1.1 will be introducing some new features as well as fixes such as the default directory and file type detection.
astro,
How are you accessing the options page? Are trying to link to it directly? Because that wont work. To access the options page, log into the Wordpress Admin, click “Setting” and then click “G4B Gallery”.
Let me know if your still having trouble.
10.24.2008
Accessing the option page as you said, the link shows up as how I wrote it above. It’s the problem with that link.
10.27.2008
When the download is unzipped it creates the folder g4b-photo-gallery. This is the folder that we’re uploading to the plugins directory. It’s the wrong folder name! You need to change the unzpip file to the correct folder. I had to manually edit the folder in plugins to match G4B_gallery (note the capital letters). It works now :(
10.27.2008
@astro - that’s the same problem other people have referenced. You need to change the folder name in plugins to G4B_gallery so the link will work.
Gavin, one feature that would be great for 1.1 is the ability to order the albums. Right now they seem to appear in alphabetical order. I’m doing a site with galleries by date, so this means the oldest one will always be on top (since 2005 comes before 2008); I really want the newest album on top. If you could select “alpha,” “date added ascending,” “date added descending,” or possibly even a custom order that would be awesome.
10.27.2008
Interesting to know.
10.28.2008
Thanks BrightBold.
10.30.2008
Anyone else having troubles with IE7? This works beautifully in Firefox but in IE7, on any page showing the contents of an album, I get a row with 5 100×100px thumbnails and then two roughly 40×40px thumbnails stacked vertically. Oddly, it works fine in IE6 (although I only ger 4 thumbnails per row, when there’s more than enough room for 5.)
Unfortunately this is a dealbreaker for me. I will check back on the progress of this plugin, because I like it, but I need it to work in all the major browsers.
10.30.2008
Hey BrightBold,
During my tests I didn’t have any issues with IE7. Have you made changes to the CSS file?
That being said, browser issues are only related to styles applied by CSS, that the plugin itself. I’ll do my best to have the default style work across all major browsers for the next release.
Thanks for the feedback.
10.30.2008
UPDATE: I just tried this page in IE7 and the demo gallery above works fine. Does it break for anybody else using IE7?
10.30.2008
Yeah, sorry - I realized after I posted that it was probably an incompatibility with my theme. It was late when I posted and I was stressed.
I am trying to figure it out now (I did override some of the styles so hopefully that’s the key). I’ll report back and let you know whether I fixed it.
10.30.2008
Totally my bad. I had a “max-width:100%” in my CSS that was getting inherited by the thumbnails, and this was breaking the g4b_photos pages. Works great now! (Although I still wish I could reverse the sort order!)
Thanks for your prompt response. If you want to see it in action, go to http://flasta.org/wp/events/.
10.30.2008
Hey BrightBold!
That theme looks great! Awesome work! Glad you got the CSS figured out. I’ll be sure to add the filtering option into 1.1 :)
10.30.2008
hello
I have 2 sites .On my both sites wordpress 2.6.3. On my first hosting your olugin work correctly but on second it doesnt work .
when i try to activate plugin i wath this
Warning: main() [function.main]: open_basedir restriction in effect. File(/G4B_gallery_functions.php) is not within the allowed path(s): (/var/www/vhosts/blogbrandaid.com/httpdocs:/tmp) in /var/www/vhosts/blogbrandaid.com/httpdocs/wp-content/plugins/g5/G4B_gallery.php on line 49
Warning: main(G4B_gallery_functions.php) [function.main]: failed to open stream: Operation not permitted in /var/www/vhosts/blogbrandaid.com/httpdocs/wp-content/plugins/g5/G4B_gallery.php on line 49
Fatal error: main() [function.require]: Failed opening required ‘G4B_gallery_functions.php’ (include_path=’.:.:.:.:’) in /var/www/vhosts/blogbrandaid.com/httpdocs/wp-content/plugins/g5/G4B_gallery.php on line 49
11.03.2008
Hi,
I’m trying to get this plugin to work, but when I go to Manage and click on the G4B Gallery button it just tries to preview by blog instead of providing me with any admin, upload etc options.
I’ve checked that the wp-content/uploads/ exists and is writable by the server (CHMOD 755).
Am I being a geek without brains or is there an issue?
Thanks!
Sarah
11.03.2008
Sorry it took so long to respond guys/gals, been out of town.
Alesto:
It looks like your using the wrong directory name. The path should look like this: “wp-content/plugins/G4B_Gallery/G4B_gallery.php”. Your path shows a “g5″.
Sarah Bourne:
I need a bit more info from you before I can help. What version of Wordpress are you using? Are you using a default installation or have you modified where plugins are installed?
11.04.2008
I’m using WP 2.6.2. Default installation. I changed the directory as suggested but still with the same result.
11.20.2008
Just installed your gallery on WP2.5.1. Created an album name then went to upload an image but got an error that says that the upload directory does not exist. It does exist, is totally writable and I have the correct name - g4b_gallery that your plugin created in my uploads. Does your gallery need Flash to work as I am now using “No Flash Uploader Plugin” due to flash v10 is not compatible with wp2.5.1 which works perfectly now for normal uploads in pages and posts.
11.20.2008
Tried to with the flash on and still cannot upload an image
11.20.2008
Thanks for making a great little plugin. When do you anticipate v 1.1 being realeased? Will the ability to create multiple albums with different galleries, for use on different pages be included? I know you said there will be the option to diplay galleries, but this is maybe one step further? Forgive me if you’ve already answered this elsewhere. I’d also love to see multiple uploads eventually.
11.25.2008
Hey Everybody. Just wanted to let you know G4B Gallery 1.1 is back under development (I got distracted for a while there). It should be ready for the new year!
All the bugs in your comments have been addressed and a variety of new features implemented.
11.25.2008
hi, is there a way i can just goto my ftp and upload a mass amount of photos on my server? i dislike the single browse feature or i just dislike uploading via browser..sometimes it stops half way on a big file…. but i see that the ftp directory is restricted..how can i lift that so i can just upload thru ftp? thank you
12.10.2008
Hi Gavin,
Just trying to get the last stage of this working…i’m sure i have it all setup as the install instructions with a folder:
cta.ie/dev/wp-content/uploads/
This folder has write permissions and all that, but when i access the G4B gallery link through the admin section to create e first album, I get a pink box:
“The upload directory doesn’t exist. Read the install instructions.”
But it is deffo there… any ideas?
Any help would be great, ta.
Alan
12.18.2008
Hi,
your gallery is great but I do have one question. Is it possible to arange albums otherwise than alphabethicaly?
Regards,
Nadja
12.18.2008
i have same problem with Alan.
What is the problem?
12.20.2008
For the people with the UPLOAD FOLDER PROBLEM
Create a new directory inside the ‘uploads’ folder with the name g4b_gallery and give the right permissions to it.
Or if you want to store your images in a different location you can modify G4B_gallery.php at line 39, it says:
define(’G4B_GALLERY_UPLOAD_DIR’, WP_CONTENT_DIR . ‘/uploads/g4b_gallery/’);
change ‘/uploads/g4b_gallery/’ for your desired location.(and make sure it has write permissions).
Thanks for the Plugin Gavin, keep it up!
12.29.2008
How the heck do I get descriptions with the images on my web page? Don’t see it on the stylesheet?
Great plugin, mate!!