I have a problem where WordPress isn’t showing line breaks when I echo the user description. The text shows in one line.
I’m using this line of code to show the user description:
<?php $user = get_user_by( 'slug', 'admin' ); echo $user->description ?>
Any idea what could be causing the problem and how to get WordPress to show the line breaks in the user description? Adding <br />
to the description box on user profile settings page doesn’t help.
I think you could do something like this:
To optimize things, you could plug it up so that your user description saves the string using
nl2br
when saved in the database.