Before/After

v0.2 Download
4

Organize “before and after” style portfolios embedded within WordPress posts. Before/After allows you to select specific images out of your media library, and sort them into respective before and after groups from the post editing page. Useful for anyone who features their work or services (web-designers, artists, plumbers, etc.) on their site.

Installation

  • Download Before/After and unzip the files
  • Upload beforeafter.php to your /wp-content/plugins/ directory
  • Activate Before/After from the ‘Plugins’ area in WordPress

Use

  • Add images to your Media Library; these images will become available to you on the post add/edit page.
  • On the post add/edit page, simply drag images from the Media Library column into the Before and After columns.
  • To remove an item, double-click it.

Template Tags

$beforeafter->is_gallery( id );

Returns true if there is a Before/After gallery associated with a particular post.

  • Arguments
  • id :
    • A post id. Typically the current post, $post->ID
$beforeafter->gallery( type , id , file , links , list , rel , limit );

Returns the images stored in a particular Before/After gallery.

  • Arguments
  • type:
    • Determines which gallery to return: before or after.
    • Values: 'before' , 'after'
    • Default: 'after'
  • id:
    • The post id. If set to 0, will return images from all posts with Before/After galleries.
    • Default: 0
  • file:
    • Determines the type of image to return: the original image file, or the thumbnail.
    • Values: 'thumb' , 'file'
    • Default: ‘thumb’
  • links:
    • If set to true, will wrap images with links to the original files.
    • Values: true, false
    • Default: true
  • list:
    • If set to true, wraps the image in <li> tags.
    • Values: true, fase
    • Default: false
  • rel:
    • Alters the default rel parameter for image links.
    • Default: 'beforeafter'
  • limit:
    • Limits how many items are returned.
    • Default All of 'em

Examples

Returns the two separate galleries associated with the current post.

<?php if ($beforeafter->is_gallery($post->ID)) : ?>

	<div>
       <h3>After</h3>
		<?php
			$beforeafter->gallery('after' , $post->ID , 'thumb' , true, false);
		?>
	</div>

	<div>
		<h3>Before</h3>
    	<?php
			$beforeafter->gallery('before' , $post->ID , 'thumb' , true , false);
		?>
	</div>

<?php endif; ?>

Returns the images from all ‘after’ galleries on all posts.

<div>
     <h3>Recent Projects</h3>
	<?php
		$beforeafter->gallery('after' , 0 , 'thumb' , true, false);
	?>
</div>

Screenshots

Before/After

Notes

Before/After is not pre-attached with any style or gallery module. You can style it any way you’d like, and the galleries will fit into many image tools like Lightbox (note the definable rel attribute). Use CSS to change things like image size.

As of now, you can use an image from the Media Library in only one Before/After gallery across the site. I’ve wired it this way to prevent potential confusion. If folks see the need to have images featured in multiple galleries, I can create the option.

Please bring any bugs, issues, or suggestions to my attention below!

  • Cvele
    I have installed wordpress 2.9.2 and I have a problem with drag and drop pictures in columns before and after. Pictures return to media library column. Any suggestions?
  • keighl
    I find it can be a little finicky on IE and Safari. Try another browser? The main problem is that the media library items are being dragged onto empty lists, so sometimes you need to wiggle them around until the first thumbails find it. After the first ones are in place it gets better. I should really put some placeholders in there.
  • dazlunn
    Hi, this looks like just the kind of thing I'm looking for some of our property refurbishments, but I would need to be able to have an album of before/after for each project, not a global album - the plugin can do this?
    I hope so because on the surface of things it looks like this is brilliant! but I just need to clarify before installing.
    (great site by the way, your Menu+ plugin looks the dogs-nuts (excellent)..)
  • keighl
    You got it, you can create a new before/after gallery for any post. So, for each project you can simply create a WordPress post, and sort a gallery for it. If you have any problems, please let me know. I built this plugin for a landscaping company ... decided to open it up.
blog comments powered by Disqus
Keighl

© 2010 Keighl

1.508.265.3032
info@keighl.com