WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] HTML in "About yourself" of profile, or at least line breaks (8 posts)

  1. dataspot
    Member
    Posted 7 years ago #

    I'm trying to get HTML to show up in users profile in their description section, or at least give them the option to have multiple paragraphs. I've looked at ticket 2272, but it doesn't work on 2.0.3.

    Are there any other things I can try? To me it seems this should be given some (non-dangerous) HTML to work with (such as line breaks, paragraphs, anchors, and images).

  2. dataspot
    Member
    Posted 7 years ago #

    bump, ow.

  3. dataspot
    Member
    Posted 7 years ago #

    LE BUMP.

  4. dataspot
    Member
    Posted 7 years ago #

    asasdsadasd

  5. dataspot
    Member
    Posted 7 years ago #

    I found a messy solution to allow some text formatting HTML. In author.php I did this:

    <?php
    $curauth->user_description = str_replace ("[p]", "", $curauth->user_description);
    $curauth->user_description = str_replace ("[/p]", "", $curauth->user_description);
    $curauth->user_description = str_replace ("[b]", "<b>", $curauth->user_description);
    $curauth->user_description = str_replace ("[/b]", "</b>", $curauth->user_description);
    $curauth->user_description = str_replace ("[u]", "<u>", $curauth->user_description);
    $curauth->user_description = str_replace ("[/u]", "</u>", $curauth->user_description);
    $curauth->user_description = str_replace ("[i]", "<i>", $curauth->user_description);
    $curauth->user_description = str_replace ("[/i]", "</i>", $curauth->user_description);
    echo $curauth->user_description; ?>

  6. AMSmith
    Member
    Posted 7 years ago #

    I just found this "messy solution."

    It's true that tags in brackets (such as [b]) don't get stripped when you save the "About Yourself" or "About the user" fields. So, perhaps this could work to add the paragraph markers back in but I'm having some problems:

    (1) Where in the author.php do you put the code? I tried putting it before the Loop and in the Loop. Didn't work.

    (2) It seems that replacing [p] and [/p] with "", isn't going to help. Wouldn't you replace them with <p> and </p>? (But that didn't work either...)

    Here is the thread I posted on:

    http://wordpress.org/support/topic/111864?replies=5#post-538523

  7. Chris_K
    Member
    Posted 7 years ago #

    You have a less messy solution back in your original thread.

  8. AMSmith
    Member
    Posted 7 years ago #

    Since it wasn't working for me at the time, I thought it would be acceptable to look at other options, while awaiting a possible reply on the code placement.

    If someone can address the questions I posted above, I would still appreciate an answer. It would help me continue to learn how WP works.

    FWIW, with the additional information, the other code works and is certainly more elegant. Try it!

Topic Closed

This topic has been closed to new replies.

About this Topic