jim912様
早速のご返信、ありがとうございます。
教えて頂いた「$posts」を使い、思っていたとおりに出来ました!
「$posts」というグローバル変数があるとは知らなかったので、
とても勉強になりました。
今回は本当にありがとうございました。
function insert_custom_css() {
global $post, $posts;
if( is_home() ) {
foreach( $posts as $post ) {
$array_css[] = get_post_meta( $post->ID, 'css', true );
}
$css = implode( "\n\n", array_filter( $array_css ) );
}
elseif ( is_single() && ! is_attachment() ) {
$css = get_post_meta( $post->ID, 'css', true );
}
if ( $css ) {
$output = '<style type="text/css">' . "\n";
$output .= $css . "\n";
$output .= '</style>' . "\n";
echo $output;
}
}
add_action( 'wp_head', 'insert_custom_css' );
お返事ありがとうございます。
プラグインは「Custom Field Template」を使用していたので、無効化してみたのですが、同じ症状のままでした。
kz様
早速の返信、有り難うございます。
試したところ思い通りの表示になりました!
プログラムの知識が乏しいので、困惑していました。
今回は、本当に感謝いたします。