[resolved] Line Breaks and About Yourself (3 posts)

  1. jakeisonline
    Posted 7 years ago #

    Currently I don't seem to be able to add linebreaks into the "About Yourself" (Description) for author profiles. As a result, when an author has a Bio which is several paragraphs, the linebreaks are not recognised when being rendered when called in to be display on the page (via $curauth->description;)

    Anyone have a solution?

  2. jakeisonline
    Posted 7 years ago #

    Fail, just answered my own post :P

    This can be resolved by using a simple PHP function called "nl2br" which basically means it will convert carriage returns (that means a text line break) into the correct HTML linebreak format, br.

    To do it, you can simply use echo nl2br($curauth->description); in order to display an Author Bio complete with HTML Linebreaks.

  3. Alber
    Posted 7 years ago #

    jakeisonline, you saved me other some hours of life!

    BTW, it's some kind of bug. I have 1 blog with this problem and another without this problem. Both are 2.7.1 and on the windows hosting. Strange...

Topic Closed

This topic has been closed to new replies.

About this Topic