Archived topic
How to Create Line Breaks or Paragraphs in Author Bio
4 replies · Started by Brian on February 3, 2021
Hi,
I've added an author box to the bottomw of my posts and I'm struggling to find a solution for breaking up the author biography. At the moment my authors biography is a giant block of text:
I found the following code to stop the sanitisation of HTML elements from the User > Edit User > Biographical Information text area.
// Disable WordPress sanitization to allow more than just $allowedtags from /wp-includes/kses.php.
remove_filter( 'pre_user_description', 'wp_filter_kses' );
// Add sanitization for WordPress posts.
add_filter( 'pre_user_description', 'wp_filter_post_kses' );
...which does allow me to add <p> or <br> elements to the text box, and doesn't strip them when saved but it won't show on the front-end in the post. Still a mass of text.
Any suggestions would be appreciated.
Lol.
Fixed - was a case of nested <p> tags.
Glad to hear you found the issue :)
Where to place this code in GeneratePress?
Hi there,
The code is PHP, you can use one of the methods introduced here to add it:
Adding PHP: https://docs.generatepress.com/article/adding-php/