- March 8, 2018 at 9:59 pm #151392
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.,
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?
Attachments:March 9, 2018 at 5:34 am #151402
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
Colorlib Support TeamMarch 10, 2018 at 3:17 am #151549
I did, thanks, and it just shows up in-line with the rest of the address. It doesn’t get interpreted as HTML.March 12, 2018 at 3:21 am #152079
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. 🙂
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. 🙂
Let us know,
laranz.March 12, 2018 at 1:27 pm #152189
That worked perfectly!!
Thanks!March 12, 2018 at 1:52 pm #152235
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!
The topic ‘Line Breaks in widget for Contact Address’ is closed to new replies.