Lida 2196 vezes
<div class="box post" id="post-<?php the_ID(); ?>"> <div class="content"> <?php $postimageurl = get_post_meta($post->ID, 'post-img', true); if ($postimageurl) { ?> <div class="pic fl"> <?php the_post_thumbnail(); ?> </div> <?php } ?> <div class="post-title"> <h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> </div> <!--/post-title --> <div class="post-date"><em>On <?php the_time('m.d.y'); ?>, In <?php the_category(', ') ?>, by <?php the_author_posts_link(); ?></em></div> <div class="post-excerpt"><?php the_excerpt(); ?></div> <!--/post-excerpt --> </div> <!--/content --> <div class="hl"></div> <div class="social-links"> <div class="fl"> <span><?php comments_number(0, 1, '%'); ?></span> <a href="<?php the_permalink(); ?>#comments" title="View Comments">Comments</a> </div> <div class="fr"><span><a href="<?php the_permalink(); ?>#respond" title="Leave Your Response">Leave Your Response</a></span></div> <br class="fix" /> </div> <!--/social-links --> </div> <!--/box -->
Vamos por partes, quando colocas o código no functions.php o menu/caixa de selecção do thumbnail aparece nos posts?
Tens este excelente artigo do Hugo Baeta no wordpress pt a explicar como se faz isso.http://wp-portugal.com/2010/02/20/miniatura-thumbnail-do-post-como-implementar/
Tenta: the_post_thumbnail('thumbnail');Duvido que seja isso, mas tenta...
add_theme_support( 'post-thumbnails' );set_post_thumbnail_size( 50, 50, true ); add_image_size( 'single-post-thumbnail', 400, 9999 );
<?php the_post_thumbnail(); ?>
/** Miniaturas */if (function_exists('add_theme_support')) { add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size(150, 150, true);}/** END Miniaturas */
<?phpif ( has_post_thumbnail() ) the_post_thumbnail('thumbnail');else echo '<img src="http://libertytuga.com/wp-content/themes/libertytugav4/images/nothumbnail.jpg" alt="" title="" />';?>
Desenvolvimento
WordPress