sami_89 adlı üyeden alıntı:
mesajı görüntüle
gerçekten özür dilerimŞuan pek zamanım yok.İsterseniz eski haline çevirin gece burdan hatasız biçimde anlatımınnı yapacağım
46
●3.034
gerçekten özür dilerim
# 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.<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.