• アイキャッチ画像を他サーバーの画像(引用した画像)に設定したいのですが可能でしょうか??

2件の返信を表示中 - 1 - 2件目 (全2件中)
  • 無理です。

    こんにちは

    どうしてそうしたいのかわかりませんが、以下のようにすれば出来ます

    functions.php

    <?php
    $spacial_eye_chatches = array( '投稿ID'=>'画像URL',
    				26064 => 'http://www.example.com/example.jpg' );
    
    add_filter( 'post_thumbnail_html', 'function_name', 10, 4 );
    
    function function_name( $return_value, $post_id, $post_thumbnail_id, $size ) {
    	global $spacial_eye_chatches;
    	if ( array_key_exists($post_id, $spacial_eye_chatches) ) {
    		preg_match( '!src="([^"]+)"!', $return_value, $regs );
    		$before	 = $regs[1];
    		$after	 = $spacial_eye_chatches[ $post_id ];
    		return str_replace( $before, $after, $return_value );
    	}
    	return $return_value;
    }
    ?>

2件の返信を表示中 - 1 - 2件目 (全2件中)

トピック「アイキャッチ画像を他サーバーの画像に」には新たに返信することはできません。