merhaba arkadaşlar 2000 tane yazı mevcut ve bunların hiçbirine öne çıkarılmış görsel ayarlamadık.
kullandığımız tema şu: http://demo.mythemeshop.com/point/
örneğin yazı içinde ekli olan resmimiz:
<img src="http://www.siteadi/wp-content/uploads/2014/03/resim-150x150.jpg" alt="resim" width="150" height="150" />
bu resmi o yazının öne çıkarılmış görseli olarak ayarlamamız lazım nasıl yapabiliriz acaba?
yazı içindeki resmi öne çıkarılmış görsel olarak ayarlamak
6
●441
- 28-07-2014, 16:32:02O şekilde de yapılabilir attached image i featured olarak gosterme ama dediğim yapılırsa php kodlari yla oynamaya gerek kalmazlookout adlı üyeden alıntı: mesajı görüntüle
- 28-07-2014, 17:04:50şö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ı.volkankey adlı üyeden alıntı: mesajı görüntüle
<?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 ); } } }