Advanced Custom Fields 値の文字数を指定する
Advanced Custom FieldsはWordPressでカスタムフィールドを使うなら必ずと言っていい程使うプラグインです。
http://www.advancedcustomfields.com/
基本的な使い方は
<?php the_field('フィールド名'); ?>
画像の場合(画像ID):
<?php $image = wp_get_attachment_image_src(get_field('フィールド名'), 'full'); ?> <img src="<?php echo $image[0]; ?>" alt="<?php echo get_the_title(get_field('フィールド名')) ?>" />
テキストを文字数を指定して表示したいときは、mb_substrでできました
<?php $text = mb_substr(get_field('フィールド名'),0,36,'utf-8'); echo $text.'...'; ?>
36文字を表示します。
こちら参考に