/ Published in: HTML
                    
                                        
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.
                Note:
Change books to your custom post name.
latestbookssize is the class I am using in the code below to style the thumbnail.
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<?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();
?>
Comments
 Subscribe to comments
                    Subscribe to comments
                
                