WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Paragraph tags are stripped (2 posts)

  1. sanctifiedesign
    Member
    Posted 7 years ago #

    I'm using the WP 2.0 and when I use the rich-text editor to create my post, I use the "enter" key to create new lines - thus creating multiple instances of the <p></p> tags. An example is:


    <p>This is paragraph 1</p><p>This is paragraph 2</p><p>This is paragraph 3</p>

    When I view the HTML for the entry before I publish it to my table it shows the above code. When I query the tables by hand in my WP database - the paragraph tags are stripped out and replaced with physical ASCII line breaks (which shouldn't render as real line breaks in HTML). I know that WP uses a function called "wpautop" which somehow replaces the ASCII line breaks with actual paragraph tags when rendering it as HTML.

    I'm using a custom-built template/theme and when it pulls the entry from the table - all the text is running to gether without the paragraph tags - thus screwing up my layout.

    My question is this: Is there a way to get WP to not strip out the paragraph tags when it enters the entry into my table?

  2. sanctifiedesign
    Member
    Posted 7 years ago #

    I think I figured out the problem. I didn't realize that under "users" - you can turn off the rich-text editing per user. This basically lets you enter in the content as raw HTML. You can write in the paragraph tags manually or just press "enter" manually to go to a new line. If you don't enter in the paragraph tags - it won't put them into the table when it inserts the data, but WP will still use its "wpautop" function to automatically insert the paragraph tags when it renders the data as HTML. If you do enter in the paragraph tags manually - it will leave them in the data when it's inserted into the table and WP will render the data as HTML correctly (meaning it won't try to insert another set of paragraph tags along with the ones manually inserted). This also allows it to work with my custom template/layout.

Topic Closed

This topic has been closed to new replies.

About this Topic