Mağara Adamı adlı üyeden alıntı

function wpforce_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=1" );
if ($attached_image) {
foreach ($attached_image as $attachment_id => $attachment) {
set_post_thumbnail($post->ID, $attachment_id);
}
}
}
} //end function
add_action('the_post', 'wpforce_featured');
add_action('save_post', 'wpforce_featured');
add_action('draft_to_publish', 'wpforce_featured');
add_action('new_to_publish', 'wpforce_featured');
add_action('pending_to_publish', 'wpforce_featured');
add_action('future_to_publish', 'wpforce_featured');


function.php de en alt kısmına ?> kodundan hemen önce yapıştır tmmdır.


Dediğiniz gibi yaptım ancak hata ile karşılaştım;

Fatal error: Call to undefined function add_action() in /home/u670966695/public_html/wp-includes/functions.php on line 4824


Ek Olarak:

karayel32 adlı üyeden alıntı

https://wordpress.org/plugins/auto-post-thumbnail/

her zaman kullanıyorum. sorunsuz çalışıyor tavsiye ederim :)




Maalesef bu eklentiler de işe yaramadı. Sorun tam olarak şöyle blogger'dan wordpress'e eklenti ile yazıları aktarıyorum. WP kendi kendine link resmini öne çıkartılmış resim yapıyor? buda eklentilerin çalışmasını engelliyor sanırım. Yardımcı olun lütfen :confused: :(