このコードの文字数を制限するにはどうすればよいですか?
.get_post_meta($post->ID,'smple1',true).
私は次のことを試しました:
$trim_length = 21; //desired length of text to display
$custom_field = 'smple1';
$value = get_post_meta($post->ID, $custom_field, true);
if ($value) {
echo '.rtrim(substr($value,0,$trim_length)) . ';
}
しかし、サーバーエラーが発生します。私はendifか何かが欠けているに違いありませんか?
どうもありがとう。