Support

Account

Home Forums Add-ons Repeater Field Limit Output Characters on Sub-Field Reply To: Limit Output Characters on Sub-Field

  • use get_sub_field and substr

    
    // limit to 10 chars
    $value = substr(get_sub_field('field_name'), 0, 10);
    echo $value;
    

    or you can use wp_trim_words() to limit to a number of words

    
    // limit to 10 words
    $value = wp_trim_words(get_sub_field('field_name'), 10);
    echo $value;