WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

GS Alternate Images

A plugin to add alternate images ability to the page/post editor

GS Alternate Images is a plugin that adds a meta box to the page and post edit pages.

Users can add images to this area by clicking on the "Add Alterante Images" button and browsing the gallery or media library.

Once images are added to the Alternate Images area, they can be extracted in a number of ways.

In it's most basic form, the attachment ID's are added to a postmeta as an array. A programmer could use existing wp functions to extract the array from the postmeta and manipulate the images as they see fit, also using existing wp functionality.

In addition this plugin add shortcode support allowing non programmers to produce a gallery of images, or ustilize the images in some other fashion.

For example.

To get an array of alternate images attachment IDs

$array_of_IDs = gs_get_alt_image_ids($post_ID); // post_ID = the page/post ID that you want to retreive the images for.


use this method to get an array of objects of images.
    $args = array (
        'post_id' => int // the numeric ID of page/post, if left black the current post is assumed.
        'class'   => string // a class name that will be appended to the image html that is generated
        'size'    => string/array  // if it's a string us standard WP imagse sizes ex: 'thumbnail' if it's an array define with and height array(50,50) if left blank it defaults to thumbnail
    );
$array_of_objects = gs_get_alt_images( $args )

Or use a short code

accepts args of
order = the image in the order as it's displayed in the panel
size = the displayed iamge size thumbnail, small, array 100,100 width,height example size=100,100
class = the class that will be inserted into the img tag

You can also use included content as a template for the image like this.
[gsaltimg]<a href = "{img_att_url}">{img_html}</a>[/gsaltimg] <!-- this will create an image with a hyper link to the full size image -->

allowed tags are
{img_html}      = full img html for the image ex <img src = "...." class = "..." />
{img_url}       = the urls to the sized image
{img_att_url}   = the url to the full sized attachment

Here is one way to use a short code and build a small gallery that alerts the actual image url.
[gsaltimg size=80,80]
<div style = "text-align: center; float: left; clear: none; margin-left: 10px; cursor: pointer; background-color: #0000FF; padding: 3px;"
onclick = "alert('hello I am {img_att_url}');"{img_html}
<p style = "color: #FFF; text-align: center;clear: both;">Click me</p></div>
[/gsaltimg]

Requires: 2.9 or higher
Compatible up to: 3.0.5
Last Updated: 2010-8-13
Downloads: 983

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,2,2
100,1,1
100,1,1
100,1,1