manset resim boyutunu ayarlama
-
merhaba basit bir haber manşeti kodu üzerinde çalışıyordum, ancak resimleri istediğim boyuta getiremiyorum. Yapmak istediğim eklenen küçük haber resimlerinin otomatik olarak manşet resim boyutunda gsterilmesini sağlamak, mümkünse büyükleri de küçültmek, manset alanım 590×320 piksel…
index.php
deki kodum;
<div class=”anasayfamanset”>
<?php query_posts(‘paged=’.$paged.’&showposts=10&cat=5′); if ( have_posts() ) while ( have_posts() ) : the_post();$m++; ?>
<div class=”manset” id=”manset<?php echo $m; ?>”<?php if($m!==1){ echo ‘ style=”display:none;”‘; } ?>>
<h2 class=”baslik”>” ><?php the_title(); ?></h2>
<?php
if (get_post_meta($post->ID, “resim”, true) != ”) {
$resim = get_post_meta($post->ID, “resim”, true);
echo “<img src='”;
echo $resim;
echo “‘ alt=”<?php the_title(); ?>” width=”590” height=”320” />”;
}
elseif (has_post_thumbnail()) {
the_post_thumbnail(‘manset’, array(‘alt’ => ”.get_the_title().”, ‘title’ => ”.get_the_title().” )); ?>
<?php } else { ?>
<img src=”<?php bloginfo(template_url); ?>/resim/resimyok_buyuk.png” alt=”<?php the_title(); ?>” width=”590px” height=”320px”></img>
<?php } ?>
</div>
<?php endwhile; ?>
<ul class=”sayfala”>
<?php $t=0;query_posts(‘paged=’.$paged.’&showposts=10&cat=’); while ( have_posts() ) : the_post(); $t++; ?>
” title=”<?php the_title(); ?>” onmouseover=”manset(<?php echo $t; ?>)”>
<?php
if (get_post_meta($post->ID, “resim”, true) != ”) {
$resim = get_post_meta($post->ID, “resim”, true);
echo “<img src='”;
echo $resim;
echo “‘ alt=”<?php the_title(); ?>” width=”590” height=”320” />”;
}
elseif (has_post_thumbnail()) {
the_post_thumbnail(‘manset’, array(‘alt’ => ”.get_the_title().”, ‘title’ => ”.get_the_title().” )); ?>
<?php } else { ?>
<img src=”<?php bloginfo(template_url); ?>/resim/resimyok.png” alt=”<?php the_title(); ?>” width=”590px” height=”320px”></img>
<?php } ?>
<?php endwhile;wp_reset_query(); ?>
<div class=”t”></div>
<div class=”t”></div>
</div> <!– /manset/ –>
css kodları;
/* ================================================ */
/* ! anasayfamanset */
/* ================================================ */
#sol .anasayfamanset {position:relative;height:350px;width:590px;}
#sol .anasayfamanset .manset{width:590px;position:relative;border-bottom:2px solid #D33232; height:320px; }
#sol .anasayfamanset ul.sayfala {height:30px;width:590px;}
#sol .anasayfamanset ul.sayfala li {float:left;font-family:arial;width:54px;padding:2px;background:#2D2D2D;padding-right:3px;}
#sol .anasayfamanset ul.sayfala li img {width:54px;height:30px;display:block;}
#sol .anasayfamanset ul.sayfala li a {display:block;}
#sol .anasayfamanset ul.sayfala li:hover {background:#D33232}
#sol .anasayfamanset h2.baslik {position:absolute;margin:10px;padding:10px;background:url(resim/galeri_video_op.png);color:#fff;}
#sol .anasayfamanset h2.baslik a {display:block;color:#fff;font-family:arial;}
#sol .anasayfamanset .sayfalama {background:#D33232;height:20px;display:block;font-family:arial;font-size:14px;color:#fff;}
#sol .anasayfamanset .sa {float:right;margin-right:5px;}
#sol .anasayfamanset .sayfalama .sa a,#sol .anasayfamanset .sayfalama .sa .current {font-weight:bold;display:inline-block;width:20px;line-height:20px;color:#fff;}
#sol .anasayfamanset .sayfalama .sa .current {cursor:default;color:#FFDDDD}
#sol .anasayfamanset .sayfalama b {float:left;margin-left:5px;font-family:arial;font-size:14px;color:#fff;}
bu haliyle resimler orjinal boyutunda görünüyor, tesekkurler
- ‘manset resim boyutunu ayarlama’ konusu yeni yanıtlara kapalı.