post thumbnail
-
I want my blog template to have a layout where each post has an image that is posted alongside the excerpt. Much like this site.
I have tried the function
the_post_image();
andthe_post_thumbnail
in my template but both give me this error:Fatal error: Call to undefined function the_post_image() in [thethemedirectory]\blogpage.php on line 27
what am I doing wrong? This is the loop I made:
<?php query_posts('category_name=websites&posts_per_page=10'); ?> <?php while (have_posts()) : the_post(); ?> <div class="posthead"> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?> </a></h3> </div><!-- /Posthead --> <div class="entry"> <div class="alignright"><?php the_post_image(); ?></div> <?php the_excerpt(); ?></div><!-- /Entry --> <p class="postmetadata"> <?php edit_post_link('Edit', '', ''); ?></p> <?php endwhile; ?>
I assume just adding an image to a post by uploading it and adding it as a thumbnail make it the post image. If I’m worng how do you add a post image to a post?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘post thumbnail’ is closed to new replies.