how to switch from using custom fields to the_post_thumbnail
-
Hi guys,
Would much appreciate your help and advice on my case.
I am currenly using free template theme where I was using custom fields to display a post thumbnail on my frontpage, archives and in posts themselves.
An example of the code that I am currenly using to display thumbnails in my excerpts is as follow:
[please mark your code using backticks or the code button – blockquote does not preserve the code]
<div class=”text”>
<?php $values = get_post_custom_values(“thumbnail”);
if (isset($values[0])) { ?>
” rel=”bookmark” >
<img src=”<?php echo bloginfo(‘template_url’); ?>/scripts/timthumb.php?src=<?php echo get_option(‘home’); ?>/<?php $values = get_post_custom_values(“thumbnail”); echo $values[0]; ?>&w=150&h=100&zc=1&q=100;” alt=”<?php the_title(); ?>” class=”left” />
<?php } ?>
<?php the_content_limit(550); ?>
<cite>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”>Читать полностью »</cite>
</div>I would love to switch to using the_post_thumbnail and inbuilt wordpress features now, But don’t want to loose all the hard work that have been done.
I have a directory called “uploads” where all my images are stored. Each thumbnail image is called by the post id.
Would appreciate a lot your help.
Many thanks
- The topic ‘how to switch from using custom fields to the_post_thumbnail’ is closed to new replies.