tags:

views:

52

answers:

1

Hi everyone,

Curious if any of you have a good solution for the following situation... because I've never thought of anything myself and usually have to resort to custom fields like "post-image-1" through "post-image-10" and manually paste the file name of a jpg in. Which is a horrible solution and only works for tech savvy posters.

Basically I want non-tech savvy users to be able to upload / attach (but not insert into the actual post content) multiple images to a post, which will be turned into a makeshift gallery.

Then I want to output these attachments in a list down the page after the post, using basic jQuery lightbox gallery functionality.

It doesn't have to be through attachments, it could be a stand alone plugin, as long as it offers customizable markup. Basically any solution that would achieve the same thing would be incredible.

Has anyone done this before? Am I missing something terribly obvious? I don't even know what exactly to call this, so I haven't had much luck with my Google research so far :(

Thanks!

+1  A: 

You can upload images to the attachment, but not actually insert them into the post, then there are some function so you can call those files.

you can check docs here http://codex.wordpress.org/Function_Reference/get_children

Here's an example

            <div id="slideshow">
            <?php
                $attachments = get_children( array(
                        'post_parent'    => get_the_ID(),
                        'post_type'      => 'attachment',
                        'numberposts'    => 10, // show all -1
                        'post_status'    => 'inherit',
                        'post_mime_type' => 'image',
                        'order'          => 'ASC',
                        'orderby'        => 'menu_order ASC'
                    ));
                unset( $attachments[ get_post_thumbnail_id($p_id) ] );
                foreach ( $attachments as $attachment_id => $attachment ) {
             ?>
                    <img src="<?php echo wp_get_attachment_url($attachment_id);?>" alt="Chevrolet" width="540" height="246" />
            <?php
                }
            ?>

omabena
BTW this link gives you a better explanation http://wpengineer.com/1735/easier-better-solutions-to-get-pictures-on-your-posts/
omabena