function autoset_featured() {
global $post;
$already_has_thumb = has_post_thumbnail($post->ID);
if (!$already_has_thumb) {
$attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=200" );
if ($attached_image) {
foreach ($attached_image as $attachment_id => $attachment) {
set_post_thumbnail($post->ID, $attachment_id);
}
}
}
} //end function
add_action('the_post', 'autoset_featured');
add_action('save_post', 'autoset_featured');
add_action('draft_to_publish', 'autoset_featured');
add_action('new_to_publish', 'autoset_featured');
add_action('pending_to_publish', 'autoset_featured');
add_action('future_to_publish', 'autoset_featured');uploads klasöründe bulunan resimler otomatik öne çıkan görseller oldu ama ben daha önceden uploads1 uploads2 gibi 3-4 klasör olarak çoğaltmıştım yedek alırken aynı resimleri bir daha indirmemek için dolayısıyla en son çoğalttığım uploads klasörü tanımlı olduğu için ondaki resimler öne çıkan görseller oldu ben diğer uploads klasörlerindeki resimler için öne çıkan görseli nasıl yaparım onun içinde bir kod varmıdır yardım edecek arkadaşlara şimdiden teşekkürler