merhaba arkadaşlar wordpress bir sistem yapıyorum fakat resimlerde şöyle bir sorunum çıktı. Önceden Özel Alan kullanıyordum haber sitemde ama şimdi temam thumbnail yani öne çıkarılmış görsel olarak destekli. Şimdi ben bir if else oluşurmam lazım eğer Thumbnail yoksa özel alana bakacak ve özel alandaki resmi alacak. Kodlarım aşağıdaki gibi. Wordpresste sıkıntı synxtax srounu çıkmadan yapabilirmiyiz ?
<div class="news"><?php query_posts("showposts=19&orderby=date&cat=".get_option('beta_manset2')."");
while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="mainLink cuff" target="_blank">
<?php $image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full'); if ( has_post_thumbnail() ) { ?>
<img width="628" height="304" alt="<?php the_title(); ?>" src="<?php bloginfo('template_url'); ?>/timthumb.php?src=<?php echo $image_url[0]; ?>&w=628&h=304&zc=0" /><?php } ?>
<strong><?php the_title(); ?></strong>
</a><?php endwhile; ?>
</div>
--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 19:12:41 -->-> Daha önceki mesaj 18:49:26 --
<div class="news">
<?php query_posts("showposts=19&orderby=date&cat=".get_option('beta_manset2').""); while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="mainLink cuff" target="_blank">
<?php if ( has_post_thumbnail() ): $image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full'); $image_url = $image_url[0]; else: $image_url = get_post_meta($post->ID, "resim", true); endif; ?>
<img width="628" height="304" alt="<?php the_title(); ?>" src="<?php bloginfo('template_url'); ?>/timthumb.php?src=<?php echo $image_url; ?>&w=628&h=304&zc=0" />
</a>
<?php endwhile; ?>
</div>