Widget admin line breaks in HTML (3 posts)

  1. andybarnes
    Posted 7 years ago #


    I have what seems to be a simple problem that I just cannot figure out...

    For example, if I add a text widget to my sidebar and enter text, hitting enter after certain lines, this does not equate to HTML
    line breaks, only carriage returns within the source code.

    Please can someone tell me how I can convert these returns to generate
    tags? I don't want to put HTML within the widget as a non-web developer will be editing the content.

    Do I need to do some sort of php replace function on the widget output? In the functions file?

    I'd really appreciate some help!


  2. The Text widget doesn't do any "smart" formatting for you. Sorry. If you want HTML breaks, then you have to put them in there yourself.

    If you want a fancier text widget that can do that sort of thing, look for a plugin to add it. Like this one:

  3. andybarnes
    Posted 7 years ago #

    Thanks for the response Otto and for the linked widget.

    But is it at all possible for me to write a php filter to take any carriage returns and replace them with BR tags before outputting the content? I thought that's the kind of thing filters are for?

    Help much appreciated!

Topic Closed

This topic has been closed to new replies.

About this Topic