trim custom field text value and show (…)
building on keatch’s answer you only need to trim if its longer the 25 chars so: $trim_length = 25; //desired length of text to display $custom_field = ‘my-custom-field-name’; $value = get_post_meta($post->ID, $custom_field, true); if ($value) { if (strlen($value) > $trim_length) $value = rtrim(substr($value,0,$trim_length)) .'(…)’; echo $value; }