logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

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

Take a look at a site using Autofocus, such as Samantha Lowe's 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?

Lawrence Krubner | 02/27/11 at 12:02am Edit
Tutorial: How to assign prize money


(5) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    02/27/11
    12:16am
    Nilesh shiragave says:

    Hi

    you can try this plugin.

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

    Previous versions of this answer: 02/27/11 at 12:16am

  • avatar
    Last edited:
    02/27/11
    12:50am
    Vidyut Kale says:

    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 Justin Tadlock'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

  • avatar
    Last edited:
    02/27/11
    6:00am
    Sébastien | French WordpressDesigner says:

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

    Previous versions of this answer: 02/27/11 at 6:00am

  • avatar
    Last edited:
    02/28/11
    10:06am
    Peter Harrison says:

    Hi,

    A great plugin for this is the Nivo Slider. There is a plugin for it here.

    Pete

  • avatar
    Last edited:
    03/01/11
    6:05am
    WPMan says:

    To grab images from the post you can use -
    - image grabber 1
    - get image
    - image grabber 2

    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.

    Previous versions of this answer: 03/01/11 at 6:05am

This question has expired.





Current status of this question: Community pot



Please log in to add additional discourse to this page.





Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.