Call to action line break

Hi Vlad, how can i add a line break in the call to action text - moesia pro - i have tried with html, but it doesnt work (row / widget / moesia call to action widget)
i have 3 lines in the call to action text and i would like to adjust the line break


thanks a lot

Hey,

You can’t, the call to action widget doesn’t allow HTML. What you can do is register your own version of the widget from your child theme and modify it. Let me know if you can handle that or if you need help.

well, i see the fp-call-to-action.php and the div class action-text, but i dont know what to change…
and in the css .action-text i have tried to do something with text-wrap, but didnt succeed
would be great if you could tell me where i need to change the code…
thanks a lot

Hey Vlad,

I experience the same problem. Would you please explain how to allow HTML specifically for e.g. “Enter your call to action.” (or for the whole widget) field in a widget modified in child theme?

Thank you

I think I’ll better add this possiblity in the next update. It’s easier than to explain :slight_smile: But if you do a search for unregister_widget on these forums you’ll see some posts about how widgets should be handled from child themes.

:slight_smile: Understand, but my issue is not creating a new modified widget and unregistering the original one …

I simply do not know how to allow HTML in the widget created by my own (for a specific input field or the whole widget if easier) in my child theme. What should be written differently in fp-call-to-action_modified.php?

Do you know probably some good source (on the web) where it is well expained?

Thank you :wink:

Ah, ok.
Find this:


$instance['action_btn_text'] = strip_tags($new_instance['action_btn_text']);

Replace with:


$instance['action_btn_text'] = $new_instance['action_btn_text'];

Find this:


$action_text 	 = isset( $instance['action_text'] ) ? esc_textarea($instance['action_text']) : '';

Replace with:


$action_text 	 = isset( $instance['action_text'] ) ? $instance['action_text'] : '';

Anything you mess up will result in your site crashing completely, so make sure you do your changes via FTP so you can easily revert :slight_smile:

Great, it works! Thank you!

Just a little subquestion :slight_smile: In order to enable line-braking by simple “Shift+Enter” shortcut, does this have something in common with this?
Or is this completely different topic?

If you have some good reference reading on the topic I would like to go through this in order to understand :slight_smile:

Thank you Vlad :wink: