Line Breaks in widget for Contact Address

Hi again (sorry, to have so many questions, but I just discovered this theme and love it),

I’m using the “Contact Form” widget on my page and where it has “Address” I’d like to create line breaks so that the address is formatted correctly, like this:

2105 CityWest Blvd.,
Suite 100,
Houston, TX 77042-2855

But because it’s typed in a field on the left in the widget, I can’t add break tags anywhere. Is it possible to do that in any way?

Hi there

Hope you are having a good day and thank you for your question
Have you tried to br tags? try to add and let me know
<br>

Thanks!
Colorlib Support Team

I did, thanks, and it just shows up in-line with the rest of the address. It doesn’t get interpreted as HTML.

Hi,

It needs a little code edit, I guide you the process, it will override in the update so you need to do that again if that is changed after update, I forward this feature request to our dev team too, so that we can make it permanenet. :slight_smile:

Go to, /wp-content/plugins/shapely-companion/inc/widgets/class-shapely-home-contact.php

and in line #264 you will see this,

'$instance[‘address’] = ( ! empty( $new_instance[‘address’] )) ? esc_html( $new_instance[‘address’] ) : ‘’;`

change that to

$instance['address'] = ( ! empty( $new_instance['address'] )) ? wp_kses_post( $new_instance['address'] ) : '';

I changed esc_html to wp_kses_post after that you can add br tag wherever you like inside the address. :slight_smile:

Let us know,

Thanks,
laranz.

That worked perfectly!!

Thanks!

Hi, there
Nice, to hear your problem is fixed:)
Now I will now close the topic and mark it as resolved. Feel free to contact us again Thanks!