Revision: 46260
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at May 15, 2011 09:09 by ala7lam
Initial Code
<?php
// The Query
query_posts( array( 'post_type' => 'books' ), 'showposts=4' );
// The Loop
while ( have_posts() ) : the_post();
echo '<a href="' . get_permalink( $thumbnail->ID ) . '" title="' . esc_attr( $thumbnail->post_title ) . '">';
echo get_the_post_thumbnail($thumbnail->ID, 'single-post-thumbnail', array('class' => 'latestbookssize'));
echo '</a>';
endwhile;
// Reset Query
wp_reset_query();
?>
Initial URL
Initial Description
am using this in my home page, next to other queries to show normal posts. Note: Change books to your custom post name. latestbookssize is the class I am using in the code below to style the thumbnail.
Initial Title
Custom posts Thumbnails with link to post
Initial Tags
Initial Language
HTML