temanın functions. php dosyasına aşağıdaki kodları ekleyin
<?php
function get_thumb($postid=0, $size='full') {
if ($postid<1)
$postid = get_the_ID();
$thumb = get_post_meta($postid, "thumb", TRUE);
if ($thumb != null or $thumb != '') {
echo $thumb;
}
elseif ($images = get_children(array(
'post_parent' => $postid,
'post_type' => 'attachment',
'numberposts' => '1',
'post_mime_type' => 'image', )))
foreach($images as $image) {
$thumbnail=wp_get_attachment_image_src($image->ID, $size);
?>
<?php echo $thumbnail[0]; ?>
<?php }
else {
echo get_bloginfo ( 'stylesheet_directory' );
echo '/img/thumbnail.gif';
}
}
?>
ana sayfada resim gösternek için home.php dosyasında satır 21...31 arasındaki kodları silin
<?php if( get_post_meta($post->ID, "thumbnail", true) ) { ?>
<img src="<?php bloginfo('template_url'); ?>/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumbnail", true); ?>&w=80&h=110&zc=1" width="80" height="110" alt="Haber önizleme" class="alignleft" />
<?php } else { ?>
<img src="<?php bloginfo('template_url'); ?>/img/thumbnail.gif" width="80" height="110" alt="Haber önizleme" class="alignleft" />
<?php } ?>
yerine aşağıdaki kodları ekleyin
<img src="<?php get_thumb($post->ID, 'full'); ?>" width="80" height="110" alt="<?php the_title(); ?>" />