WordPress.org

Ready to get started?Download WordPress

Forums

Text formatting doesn't work? Ignores tag in post body (7 posts)

  1. lenglain
    Member
    Posted 1 year ago #

    Hi, I am using the Lensa theme on my localhost, and for some reason, it won't allow me to format the text in the body of the post.

    Even though I even used the HTML editor and inserted
    tags after each line, when I go to the front page, the excerpt shows the text as one paragraph?

    instead of this:

    1. example text

    2.example text

    I get this:

    1.example text2. example text.

    no matter what I do. What could be causing this?

    Thank you

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

  3. Ryan Cowles
    Member
    Posted 1 year ago #

    WPyogi is correct, the_excerpt() will strip your tags. If you want to preserve the tags, you can manually enter an excerpt on your post edit screen in the Excerpt field under the post edit box.

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Even better answer, Ryan - thanks (you really do a great job here :) )

  5. Ryan Cowles
    Member
    Posted 1 year ago #

    Glad to help :) And I don't do half as much as you, haha.

  6. lenglain
    Member
    Posted 1 year ago #

    Thank you guys I really appreciate the quick responses.

    You're right the excerpt strips out tags, but for some weird reason, the lensa theme (which is a slideshow theme) breaks if you enter an excerpt manually in the excerpt editor (the slideshow never loads). I've tried changing all the get_the_excerpt() functions in the theme's php files to get the content but that breaks the theme too, is there anyway I can manually remove the function that strips html tags from excerpts?

    Such a small and frustrating hiccup, this is for a non-profit project, I'm tasked with setting up the website in a day!

  7. Ryan Cowles
    Member
    Posted 1 year ago #

    It seems strange that the theme would break when using a manual excerpt.. I did a little digging, and while I'm not 100% sure if it will help in your case or not, here is a more in depth article about preserving tags in the_excerpt() How To preserve HTML Tags in WordPress Excerpt Without a Plugin

Topic Closed

This topic has been closed to new replies.

About this Topic