Custom post thumbnails to WordPress posts
You can define a custom post thumbnail by adding following code to your WP theme. For this you need to create a custom field called post-img add a URL to your image.
<?php $postimageurl = get_post_meta($post->ID, 'post-img', true); if ($postimageurl) { ?> <a href="<?php the_permalink(); ?>" rel="bookmark"><img src="<?php echo $postimageurl; ?>" alt="<?php the_title(); ?>" width="150" height="150" /></a> <?php } else { ?> <a href="<?php the_permalink(); ?>" rel="bookmark"><img src="<?php bloginfo('template_url'); ?>/images/my-default-img.png" alt="<?php the_title(); ?>" width="210" height="210" /></a> <?php } ?> |