get_post_meta vs. the_post_thumbnail
-
I have piece of code from my template which take thumbnails from cutom field:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <li class="zoom"> <div><a href="<?php echo get_post_meta($post->ID, "portfolio_big", true);?>" class="thumbnail" rel="group"><img src="<?php echo get_post_meta($post->ID, "portfolio_small", true);?>" alt="" /></a></div> <h2><?php the_title(); ?></h2> </li> <?php endwhile; else: ?>
i would like to change it to use the post_thumbnail feature an no more customfields.
post_thumbnail support is added to the functions.php but when I change the code to:<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <li class="zoom"> <div><a href="<?php echo the_post_thumbnail($post->ID, "portfolio_big", true);?>" class="thumbnail" rel="group"><img src="<?php echo the_post_thumbnail($post->ID, "portfolio_small", true);?>" alt="" /></a></div> <h2><?php the_title(); ?></h2> </li> <?php endwhile; else: ?>
it’s not working, what ist the mistake ?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘get_post_meta vs. the_post_thumbnail’ is closed to new replies.