โอ้ขอบคุณทั้ง 4 ท่านมากเลยครับ TonHaDy, witme, 9keepgoing, romance69 +1
ผมใช้อีกวิธีลบให้สั้นจิ๋วกว่าเดิมโดยการเรียกใช้แต่ <?php postimage(768,384) ?> ลืมไปเลยว่าใน functions ที่ผมโหลดมาโมนั้นมันมีภาพ default มาให้อยู่แล้ว

ผมนี้นำโค้ดมาแปะจนลืมตรวจทานเลยว่า functions มันมีมาอยู่แล้ว
อันนี้จากโค้ดเดิม
<a href="<?php the_permalink() ?>" class="uk-thumbnail post-image" title="<?php the_title() ?>">
<?php if (postimage(768,384)): ?>
<?php postimage('jindaCover', array('alt' => get_the_title())) ?>
<?php else: ?>
<img src="http://www.placehold.it/768x384" alt="<?php the_title() ?>" />
<?php endif ?>
</a>
สรุปใช้แค่นี้ครับโดยลบโค้ดเก่าออก
<a href="<?php the_permalink() ?>" class="uk-thumbnail post-image" title="<?php the_title() ?>">
<?php postimage(768,384) ?>
</a>
function postimage($width,$height) {
$scriptpath = get_bloginfo('template_directory');
$attachments = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order'));
$img = array_shift($attachments);
$imagelink = wp_get_attachment_image_src($img->ID,'full');
$image = $imagelink[0];
if($image=='') {
$image = $scriptpath."/img/default.gif";
echo '<img src="'.$scriptpath.'/scripts/timthumb.php?src='.$image.'&w='.$width.'&h='.$height.'&zc=1" alt="" />';
}else {
echo '<img src="'.$scriptpath.'/scripts/timthumb.php?src='.$image.'&w='.$width.'&h='.$height.'&zc=1" alt="" />';
}
}