Using query_posts the_post_thumbnail doesn't seem to work
-
I’m trying to display a thumbnail next to the post excerpt using query_posts, but the_post_thumbnail() function isn’t working. I don’t know if it is a conflict with the query_posts function or not, but any help would be appreciated.
Here is a sample of the code:
<?php query_posts('showposts=2&cat=8'); ?> <?php while (have_posts()) : the_post(); ?> <div class="theme"> <a href="<?php the_permalink(); ?>"><span class="thumb"><?php the_post_thumbnail(); ?></span></a> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p class="author"><strong>Author:</strong> <a href="<?php the_permalink(); ?>"><?php $themeAuthor = get_post_custom_values('Author'); echo $themeAuthor[0]; ?></a></p> <?php the_excerpt(); ?> <p class="cats"><?php the_category(', '); ?></p> <p><a href="<?php the_permalink(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/download.gif" alt="Download <?php the_title(); ?> Now!" /></a></p> </div> <?php endwhile;?>
Also, yes I have added the post-thumbnails add_theme_support code to the functions.php file as well:
<?php add_theme_support('post-thumbnails'); set_post_thumbnail_size( 194, 155, true ); // Theme post thumbnails add_image_size( 'article-post-thumbnail', 281, 162 ); // Article thumbnail size add_image_size( 'mini-post-thumbnail', 80, 80 ); // Mini thumbs ?>
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Using query_posts the_post_thumbnail doesn't seem to work’ is closed to new replies.