Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

How to grab all images in a post and transform into slideshow? WordPress

Take a look at a site using Autofocus, such as [[LINK href="http://samanthalowe.com/?p=654"]]Samantha Lowe's[[/LINK]] site. For various reasons I do not want to use AutoFocus for my new project, but I'm wondering if there is a plugin I can use that will grab all the images in a post and turn them into a slideshow like that?

If not a plugin, what might be another way to get that kind of slideshow?

Answers (5)

2011-02-27

Nilesh shiragave answers:

Hi

you can try this plugin.

http://codecanyon.net/item/slider-gallery-shortcode/116049

2011-02-27

Vidyut Kale answers:

Create a shortcode. Something like:


function news_slideshow_shortcode( $attr ) {
global $post;

/* Set up the defaults for the slideshow shortcode. */
$defaults = array(
'order' => 'ASC',
'orderby' => 'menu_order ID',
'id' => $post->ID,
'size' => 'news-slideshow',
'include' => '',
'exclude' => '',
'numberposts' => -1,
);
$attr = shortcode_atts( $defaults, $attr );

/* Allow users to overwrite the default args. */
extract( apply_atomic( 'slideshow_shortcode_args', $attr ) );

/* Arguments for get_children(). */
$children = array(
'post_parent' => intval( $id ),
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => $order,
'orderby' => $orderby,
'exclude' => absint( $exclude ),
'include' => absint( $include ),
'numberposts' => intval( $numberposts ),
);

/* Get image attachments. If none, return. */
$attachments = get_children( $children );

if ( empty( $attachments ) )
return '';

/* If is feed, leave the default WP settings. We're only worried about on-site presentation. */
if ( is_feed() ) {
$output = "\n";
foreach ( $attachments as $id => $attachment )
$output .= wp_get_attachment_link( $id, $size, true ) . "\n";
return $output;
}

$slideshow = '<div class="slideshow-set"><div class="slideshow-items">';

$i = 0;

foreach ( $attachments as $attachment ) {

/* Open item. */
$slideshow .= '<div class="slideshow-item item item-' . ++$i . '">';

/* Get image. */
$slideshow .= wp_get_attachment_link( $attachment->ID, $size, true, false );

/* Check for caption. */
if ( !empty( $attachment->post_excerpt ) )
$caption = $attachment->post_excerpt;
elseif ( !empty( $attachment->post_content ) )
$caption = $attachment->post_content;
else
$caption = '';

if ( !empty( $caption ) ) {
$slideshow .= '<div class="slideshow-caption">';
$slideshow .= '<a class="slideshow-caption-control">' . __( 'Caption', hybrid_get_textdomain() ) . '</a>';
$slideshow .= '<div class="slideshow-caption-text">' . $caption . '</div>';
$slideshow .= '</div>';
}

$slideshow .= '</div>';
}

$slideshow .= '</div><div class="slideshow-controls">';

$slideshow .= '<div class="slideshow-pager"></div>';
$slideshow .= '<div class="slideshow-nav">';
$slideshow .= '<a class="slider-prev">' . __( 'Previous', hybrid_get_textdomain() ) . '</a>';
$slideshow .= '<a class="slider-next">' . __( 'Next', hybrid_get_textdomain() ) . '</a>';
$slideshow .= '</div>';

$slideshow .= '</div>';

$slideshow .= '</div><!-- End slideshow. -->';

return apply_atomic( 'slideshow_shortcode', $slideshow );
}
add_shortcode( 'slideshow', 'news_slideshow_shortcode' );


This is from [[LINK href="http://themehybrid.com"]]Justin Tadlock[[/LINK]]'s theme News built on his Hybrid Core, but you should be able to adapt it for something similar.

Then you will have to add some javascript to make it go - like the jQuery cycle plugin

2011-02-27

Sébastien | French WordpressDesigner answers:

Nextgen gallery is the best plugin to manage photo and create gallery and slideshow


Sébastien | French WordpressDesigner comments:

I have work for you Lawrence !
I have extract all the system of slideshow/gallery from autofocus and now i have a pack that you can install where you want.
demo here in Twentyten theme : [[LINK href="http://demo1.archiparmentier.com/?p=731"]]http://demo1.archiparmentier.com/?p=731[[/LINK]]

I worked for two hours. I propose a fee of $ 20. Does it suit you?


Sébastien | French WordpressDesigner comments:

perhaps more understandable. (is it ?) :

i worked for you Lawrence.
I extracted all the system of slideshow/gallery from autofocus and now i have a pack you can install where you want.

demo here in Twentyten theme : http://demo1.archiparmentier.com/?p=731


Sébastien | French WordpressDesigner comments:

are you interested lawrence ?


Sébastien | French WordpressDesigner comments:

Lawrence ? :-)

2011-02-28

Peter Harrison answers:

Hi,

A great plugin for this is the [[LINK href="http://nivo.dev7studios.com/"]]Nivo Slider[[/LINK]]. There is a plugin for it [[LINK href="http://wordpress.org/extend/plugins/wp-nivo-slider/"]]here[[/LINK]].

Pete

2011-03-01

WPMan answers:

To grab images from the post you can use -
- [[LINK href="http://wordpress.org/extend/plugins/simple-image-grabber/"]]image grabber 1[[/LINK]]
- [[LINK href="http://wordpress.org/extend/plugins/get-the-image/"]]get image[[/LINK]]
- [[LINK href="http://wordpress.org/extend/plugins/wp-auto-image-grabber/"]]image grabber 2[[/LINK]]

Once you get list of images from a particular post
get an jquery/javascript/ajax slide-show plugin for the desired presentable output (slide-show).

I am available to develop this for you in $20.