• Hi,

    I’m creating a WP “template” for a client with the idea that the client will create posts using this template and categorize the post to display it on the appropriate page. For each post the client would like the ability to add a few images (not a specific number, will vary from post to post) that will be shown on a specific part of the page.

    I know some code to display a SINGLE thumbnail, but how do I show multiple images from each post in a feed? Are there any plug-ins?

    Here’s some code I use to display a single thumbnail:

    <?php query_posts('cat=7&posts_per_page=20'); ?>
                            <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
                            <?php
                            	if(has_post_thumbnail($post->ID)){
    								$thumbsrc = get_the_post_thumbnail($post->ID,'thumbnail');
    							}else{
    								$thumbsrc = "<img src=\"http://65.213.231.100/~wizard/sundancemarineusa.com/images/no_news_image.jpg\" alt=\"" . get_the_title() . "\">";
    							}
    						?>
                                <a class="news_block" href="<?php the_permalink(); ?>">
                                	<?php echo $thumbsrc; ?>
                                	<span class="news_title"><?php the_title(); ?></span>
                                    <?php the_advanced_excerpt('length=25'); ?>
                                </a>
                                <div class="spacer" style="height:15px;"></div>
                            <?php endwhile; ?>

    Thanks for your help!

The topic ‘Displaying Multiple Images from a Post’ is closed to new replies.