This topic has 8 replies, 3 voices, and was last updated 7 years by Radu.

  • Author
  • #126464
     dsniche
    Participant

    On the profile page, I have several fields with multi-line text area. Some people write long texts in these boxes and the problem is that the line breaks don’t appear.

    For example I write two paragraphs, hitting enter twice so there’s a line break between them in the text editor. When I save the text, it appears on the front end without the line break so the paragraphs are close together, which can look cramped.

    I attached screenshots to show what I mean.

    How do I make it so the line breaks appear on the front end?

    Thank you.

    Attachments:
    You must be logged in to view attached files.
    #126628
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #126762
     Radu
    Moderator

    Hi,

    Try to add this line into child theme functions php (wp-cotent/themes/sweetdate-child/functions.php)

    COPY CODE
    
    add_filter( 'xprofile_get_field_data','wpautop' );
    

    Another possible solutions here : https://buddypress.org/support/topic/line-breaks-in-profile-fields-descriptions-not-showing/

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #126809
     dsniche
    Participant

    Hi Radu,

    I appreciate the help.

    I tried the code you gave me above but it didn’t work.

    I’m not sure how to implement the possible solution from the buddypress forum. I tried inserting “echo wpautop($data);” and it didn’t work either.

    Any other ideas?

    Thank you.

    #127032
     Radu
    Moderator

    Hi,

    No problem,

    I’ve understand that not works, please try also this solution : https://buddypress.org/support/topic/no-html-allowed-on-front-end-profile-page/ see latest reply

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #127342
     dsniche
    Participant

    Hi Radu,

    Thanks for the suggestions.

    The file referenced in that thread is in plugins/buddypress/bp-xprofile/bp-xprofile-filters.php — is it safe to edit this file?

    Also, it’s an old thread so I’m not sure if it’s still relevant, because on line 48 is this: “add_filter( ‘xprofile_field_name_before_save’, ‘force_balance_tags’ );”

    #127421
     Radu
    Moderator

    Hi,

    Backup the file before you will change it after that backup again the file with the modification by renaming something like that

    original-bp-xprofile-filters.php
    modified-bp-xprofile-filters.php

    Also the modified file should be saved on your computer when the plugin will be updated the file will be overwritten

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #128047
     dsniche
    Participant

    Hi Radu,

    I couldn’t get it to work by adding add_filter( ‘xprofile_get_field_data’,’wpautop’ );

    Maybe I didn’t put it in the correct place? Do you know where exactly in the file to add it in? The thread is 3 years old so maybe the placements have changed.

    Thank you.

    #128095
     Radu
    Moderator

    Hi,

    If you need to have multiple lines use Multi-line Text Area instead your current field type.

    It will render like this

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?