Support » Plugin: Advanced Custom Fields » Not inserting line breaks in textarea

  • Resolved sparky672

    (@sparky672)


    I have the “convert new lines into <br/> tags” option set on my textarea fields but this is not working. No <br/> tags are inserted into the content and everything displays as one long string.

    I’ve tried adding an extra blank line between each line, but it makes no difference to how it displays as the browser naturally ignores extra whitespace.

    http://wordpress.org/plugins/advanced-custom-fields/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Here’s my temporary workaround until the developer issues a permanent fix.

    In my template, where I insert the value of the textarea, I use a PHP nl2br.

    $my_textarea_value = get_post_meta(...);
    
    //echo $my_textarea_value; // instead of this
    
    echo nl2br($my_textarea_value); // do this

    I heard back from the developer. If I use the function, get_field(), which is provided automatically by his plugin, auto-BR works fine.

    $my_textarea_value = get_field(...);  // function is part of ACF plugin
    
    echo $my_textarea_value;
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not inserting line breaks in textarea’ is closed to new replies.