Thumb diferente da imagem do post
-
Amigos,
Primeiro queria deixar claro que não sou programador. Consigo entender alguma coisa, mas acho que o que estou querendo é bem avançado.O maior problema é que comecei usando um template que não fazia uso da função Thumb da versão 2.9.2.
http://www.wpthemedesigner.com/2009/12/04/render-magazine-theme/Explicando… O thema Render Magazine faz um thumbnail automáticamente com a imagem que for inserida no Post. Mas ela da um crop, e isso não é sempre legal. Eu gostaria de poder escolher a imagem que irá aparecer no thumb do post, e deixar a imagem do post na exibição do “carrossel”.
Descobri que as funções responsáveis pelo Thumb estão em:
archives.php:
<!-- begin post --> <div class="post"> <a class="thumb" href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?></a> <div class="r"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_excerpt(); ?> <p class="links"><?php the_time('m.j.y') ?> | <?php the_category(', ') ?> | <?php the_author_posts_link(); ?></p> <p class="comments"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></p> </div> </div> <!-- end post -->functions.php:
# Displays post image attachment (sizes: thumbnail, medium, full) function dp_attachment_image($postid=0, $size='thumbnail', $attributes='') { if ($postid<1) $postid = get_the_ID(); if ($images = get_children(array( 'post_parent' => $postid, 'post_type' => 'attachment', 'numberposts' => 1, 'post_mime_type' => 'image',))) foreach($images as $image) { $attachment=wp_get_attachment_image_src($image->ID, $size); ?><img src="<?php echo $attachment[0]; ?>" <?php echo $attributes; ?> /><?php } }index.php:
<!-- BEGIN content --># Displays post image attachment (sizes: thumbnail, medium, full) function dp_attachment_image($postid=0, $size='thumbnail', $attributes='') { if ($postid<1) $postid = get_the_ID(); if ($images = get_children(array( 'post_parent' => $postid, 'post_type' => 'attachment', 'numberposts' => 1, 'post_mime_type' => 'image',))) foreach($images as $image) { $attachment=wp_get_attachment_image_src($image->ID, $size); ?><img src="<?php echo $attachment[0]; ?>" <?php echo $attributes; ?> /><?php } } <div id="content"> <?php include("featured.php"); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <!-- begin post --> <div class="post"> <a class="thumb" href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?></a> <div class="r"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_excerpt(); ?> <p class="links"><?php the_time('m.j.y') ?> | <?php the_category(', ') ?> | <?php the_author_posts_link(); ?></p> <p class="comments"><?php comments_popup_link('Comente', '1 Comentário', '% Comentários'); ?></p> </div> </div> <!-- end post -->Agradeço se poderem me ajudar!!
O tópico ‘Thumb diferente da imagem do post’ está fechado para novas respostas.