seal05 şu özel alan olayını anlatsan ve css dosyasına eklenecek kodları koysan
çünkü tüm temalarda aynı sıkıntı var
Hocam ilk olarak temaları yapan kişi functions.php dosyasında şöyle bi bölüm yaratmış ilk olarak o bölümü sildim.
# Displays post image attachment (sizes: thumbnail, medium, full)
# 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
}
}Daha sonra index.php kaynak kodlarını inceleyerek resimleri hangi div kodunda çerçeveliceğine baktım.Emperors dosyasında
<!-- begin post -->
<div class="fpost">
satırını buldum.Css dosyasından Fpost aratarak css dosyasındaki terimlerden img bölümünü buldum.Resimleri Aşağıdaki css kodlarına göre gösteriyodu.
#content .featured img {
float: left;
margin: 0 10px 10px 0;
border: 1px solid #CCCCCC;
padding: 5px;
}bende bunu değiştirerek şu hale getirdim.(Boyutlandırma olayı burada)
#content .featured img {
float: left;
margin: 0 10px 10px 0;
border: 1px solid #CCCCCC;
padding: 5px;
max-width: 150px;
max-height: 150px;
}Buradaki 150px boyutlarını siz kendi isteğinize göre değiştirebilirsiniz.150x150 kare boyutlandırdım ben.
Css dosyamızıda ayarladıktan sonra index.php dosyamızdan <div class="fpost"> tagından sonra resim çeken kodumuzu buldum.Örnek;
<a href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?></a>
Daha sonra onu aşağıdaki kodla değiştirdim.
<p class="img"><img src="<?php $values = get_post_custom_values("resim"); echo $values[0]; ?>" alt="<?php the_title(); ?>"/></a>Bu işlemlerden sonra özel alan ismi resim olacak şekilde resimlerinizi sergileyebilirsiniz.
Diğer temaları kurcalamadığım için sadece bu temaya göre anlattım.Umarım mantığını anlamışsınızdır.Diğer temalarda bunun gibi yöntemle halledilebilir