How do I put featured image thumbnail from a page on the main index in wordpress

I am trying to put the featured image from a page on the main index page of blog along with the with featured images from posts (post featured images are already there). For longer posts I want to be able split them up into multiple post, put them under one category, put that category page on the main index and then have each of those on that category page.

Here is the site:

Read More

http://theshalomimaginative.com/blog

thanks!

Related posts

Leave a Reply

1 comment

  1. You would do this by setting up a custom query and then running through that picking out the featured image for the specified page. The example below uses the page with an ID of 7.

    <?php $featured_image = new WP_Query('page_id=7'); ?>
        <?php while ($featured_image->have_posts()) : $featured_image->the_post(); ?>
    
    
        <?php if (function_exists('has_post_thumbnail') && has_post_thumbnail()) { ?>
    
            <?php $img_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), array( 960,960 )); ?>
    
            <div class="the-image">
                <a href="<?php the_permalink; ?>"><img src="<?php echo $img_src[0]; ?>" /></a> 
            </div>
    
        <?php }; ?>
    
        <?php endwhile; ?>
     <?php wp_reset_query(); ?>     
    

    Then elsewhere you would set up another custom query to pull the posts from your specific post category and run the same type of script, just changing the parameters of WP_Query.ie;

            <?php $featured_postimages = new WP_Query('cat=4&posts_per_page=-1'); ?>
              <?php while ($featured_postimages->have_posts()) : $featured_postimages->the_post(); ?>
    

    *EDIT 2

    OK, I understand – let’s have another go. The code above stays exactly the same. What changes is the template you use for this custom page (the one the featured image is linking to).

    You need to set up a custom template and assign it to the custom page. It’s within that custom template that you call your list of posts;

    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates