[Resolved] How to Create Line Breaks or Paragraphs in Author Bio

Home Forums Support [Resolved] How to Create Line Breaks or Paragraphs in Author Bio

Home Forums Support How to Create Line Breaks or Paragraphs in Author Bio

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1643942
    Brian

    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:

    https://ibb.co/HHhNV44

    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.

    #1643980
    Brian

    Lol.

    Fixed – was a case of nested <p> tags.

    #1644053
    David
    Staff
    Customer Support

    Glad to hear you found the issue 🙂

    #2308868
    Ivaylo

    Where to place this code in GeneratePress?

    #2309231
    Ying
    Staff
    Customer Support

    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/

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.