volkankey adlı üyeden alıntı: mesajı görüntüle
O şekilde de yapılabilir attached image i featured olarak gosterme ama dediğim yapılırsa php kodlari yla oynamaya gerek kalmaz
şöyle bir kod buldum eklenti olarak çalışıyor, yeni yazı eklerken veya yazıyı güncelleyince otomatik öne çıkarılmış görseli ayarlıyor. yazıda ekli olan resmi.. ama tümünü herhangi bir güncelleme gerektirmeden yapabilmem gerekiyor. phpmyadminden de bulamadım gerekli kısmı.

<?php
/**
 * Plugin Name: Set featured image
 * Plugin URI: http://bueltge.de
 * Description: Set featureed image automaticly on save post/page
 * Version: 1.0.0
 * Author: Frank Bültge
 * Author URI: http://bueltge.de
 * License: GPLv3
 */
// This file is not called by WordPress. We don't like that.
! defined( 'ABSPATH' ) and exit;
if ( ! function_exists( 'fb_set_featured_image' ) ) {
 add_action( 'save_post', 'fb_set_featured_image' );
 function fb_set_featured_image() {
 
 if ( ! isset( $GLOBALS['post']->ID ) )
 return NULL;
 
 if ( has_post_thumbnail( get_the_ID() ) )
 return NULL;
 
 $args = array(
 'numberposts' => 1,
 'order' => 'ASC', // DESC for the last image
 'post_mime_type' => 'image',
 'post_parent' => get_the_ID(),
 'post_status' => NULL,
 'post_type' => 'attachment'
 );
 
 $attached_image = get_children( $args );
 if ( $attached_image ) {
 foreach ( $attached_image as $attachment_id => $attachment )
 set_post_thumbnail( get_the_ID(), $attachment_id );
 }
 
 }
}