Viewing 8 replies - 1 through 8 (of 8 total)
  • How are you getting the value?
    Are you filtering it somehow?
    Can you please post the code you’re using to echo the textarea’s contents in your theme/plugin?

    Thread Starter Youngbloodr77

    (@youngbloodr77)

    Hi Aristeides,

    Thanks for getting back to me. I’m currently using the standard way (I think) of calling the custom value.

    Setting my textarea field like so

    $fields[] = array(
    ‘type’ => ‘textarea’,
    ‘settings’ => ‘footer_site_info’,
    ‘label’ => __( ‘Footer Site Info’, ‘troubleshoota’ ),
    ‘section’ => ‘footer_general’,
    ‘default’ => ”,
    ‘priority’ => 20
    );

    Calling the field like so:

    <?php echo get_theme_mod( ‘footer_site_info’, ” ); ?>

    Cheers

    Try this:
    <?php echo html_entity_decode( get_theme_mod( 'footer_site_info', '' ) ); ?>

    Thread Starter Youngbloodr77

    (@youngbloodr77)

    Thanks for taking the time to look into this. Unfortunately still not recognising line-breaks sorry.

    What if you add your field like this:

    $fields[] = array(
    	'type'              => 'textarea',
    	'settings'          => 'footer_site_info',
    	'label'             => __( 'Footer Site Info', 'troubleshoota' ),
    	'section'           => 'footer_general',
    	'default'           => '',
    	'priority'          => 20,
    	'sanitize_callback' => 'esc_html',
    );

    and then call the value using

    echo html_entity_decode( get_theme_mod( 'footer_site_info', '' ) );

    Thread Starter Youngbloodr77

    (@youngbloodr77)

    Still no luck sorry. I take it this works fine on your side?

    Thanks for your patience Aristeides.

    Hey there,

    I tried to resolve this by using the wpautop function like this:

    <?php echo wpautop( get_theme_mod( 'footer_site_info', '' ) ); ?>

    Could this be a working solution for you?

    Please advise,
    Dimitris

    Thread Starter Youngbloodr77

    (@youngbloodr77)

    Nice!!! That did the trick.

    Thanks a bunch to both of you for your input on this one.

    Matt

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Textarea line breaks’ is closed to new replies.