Administrators Nathan Posted May 7, 2012 Administrators Posted May 7, 2012 A while back I was asking for a simple Wordpress photo gallery. No one ended up providing a decent solution, so I decided to create something on my own. I like the native Wordpress photo gallery, but it doesn't have anything to get you to the next picture after you click to enlarge a thumbnail, that's not very user friendly. I want people to actually view my photo gallery, if it's not convenient then people are not going to use it. I was using NexGen Gallery, but it's bloated and the pictures don't load as quickly as I would like. So here is a simple solution. I read that with the native Wordpress gallery it searches to see if you have a image.php file present, if not it uses the Single.php file. I took a look at my theme and there is no Image.php file there. So I took my Single.php file and saved it as Image.php. A couple minor changes to make to this Image.php file: Find and remove: <?php the_content(); ?> Replace with: <div style="float:right;"><?php next_image_link(false, 'Next Pic') ?></div><?php previous_image_link(false, 'Previous Pic') ?><br /> <div style="text-align: center;"><a href="<?php echo wp_get_attachment_url($post->ID); ?>"><?php echo wp_get_attachment_image( $post->ID, 'large' ); ?></a></div> <?php if ( !empty($post->post_excerpt) ) the_excerpt(); ?><br /> That's it, save it off and upload into your theme directory. It makes it so simple, no if someone clicks a thumbnail in your gallery they can view that picture and also have links to view the next one or go back to previous without backing up to the gallery. Quote
ChuckTesta Posted May 7, 2012 Posted May 7, 2012 I've been wanting a specific photo plugin that works with the comment section. So if you call a certain image # it will show a thumbnail of it. That's what you should make. Quote
Administrators Nathan Posted May 7, 2012 Author Administrators Posted May 7, 2012 Ah, don't have any comments on each picture with this, only comments on the photo gallery overall. Quote
ChuckTesta Posted May 7, 2012 Posted May 7, 2012 That's what i mean. If you comment on the page, you can say something like " #3 is sweet!" and it will display a thumbnail of number 3 image next to the comment. Quote
Administrators Nathan Posted May 7, 2012 Author Administrators Posted May 7, 2012 Ah yeah, maybe I could work on something like that, probably wouldn't be too hard now that I see how the system works. Just realized you wanted a link to see it in action. Native Wordpress Gallery Edit Quote
ChuckTesta Posted May 7, 2012 Posted May 7, 2012 Looks good man. I like it. you did a nice job. Nathan 1 Quote
Victor Leigh Posted May 11, 2012 Posted May 11, 2012 Ah yeah, maybe I could work on something like that, probably wouldn't be too hard now that I see how the system works. Just realized you wanted a link to see it in action. Native Wordpress Gallery Edit Just tried your link. The pictures didn't load very fast on my browser. I mean I can see it showing bit by bit. Not at a snail's pace but still slow. Maybe it's my computer's fault. Is there any way to make those pictures pop up, so to say? Quote
Administrators Nathan Posted May 11, 2012 Author Administrators Posted May 11, 2012 It's your computer or connection, fly's on both my desktops and laptops. Quote
SpikeTheLobster Posted May 12, 2012 Posted May 12, 2012 It's your computer or connection, fly's on both my desktops and laptops. It reloads the whole page, though, which is probably why it's slower on his computer (and mine), especially with ads and stuff reloading as well. Probably best used on a no-ad or text-ad site, rather than one which could potentially load great big heavy Flash things. Nice little tweak, there. Never used the WP gallery myself - I always use Coppermine for gallery sites and haven't mixed the two (though they do mix, apparently). Quote
Sherlock Posted May 31, 2012 Posted May 31, 2012 I like it! It's s nice feature. I'll defiantly be using it!! Thanks for sharing.... Quote
Administrators Nathan Posted May 31, 2012 Author Administrators Posted May 31, 2012 It reloads the whole page, though, which is probably why it's slower on his computer (and mine), especially with ads and stuff reloading as well. Probably best used on a no-ad or text-ad site, rather than one which could potentially load great big heavy Flash things. Nice little tweak, there. Never used the WP gallery myself - I always use Coppermine for gallery sites and haven't mixed the two (though they do mix, apparently). Yeah good call, maybe I should continue a little further with this so the entire page doesn't reload only the pictures. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.