WordPress.org

Support

Support » How-To and Troubleshooting » <br /> used instead of <p>

<br /> used instead of <p>

  • On my posts at http://gary.verticentricity.com,
    tags are used where I have carriage returns in my posts, but I would like the posts to split into paragraphs where the carriage returns occur in the text.

    For instance, this:

    First paragraph text followed by a carriage return
    Second paragraph text

    Would convert to this:

    <p>First paragraph text followed by a carriage return</p>
    <p>Second paragraph text</p>

    Not this:

    <p>First paragraph text followed by a carriage return<br />
    Second paragraph text</p>

    It’s probably a simple fix, but I don’t know where to begin looking. I am familiar with PHP, so I don’t mind hacking a little to get this functionality.

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • In WP text editor, if you press ENTER twice, it will create a new paragraph; single ENTER creates a line break.

    I tried that, but it didn’t work. You actually have to use three carriage returns–press ENTER three times; you need two carriage returns between your text’s paragraphs in order to get a resulting HTML paragraph.

    So to make:

    <p>First paragraph text followed by a carriage return</p>
    <p>Second paragraph text</p>

    You would need:

    First paragraph text followed by a carriage return

    Second paragraph text

    Hope this helps someone else.

    Notes to developers of bbPress:

    • Backticks don’t carry through more than one carriage return
      The previous post didn’t display correctly. The backticks surround “First paragraph text followed by a carriage return

      Second paragraph text,” but it doesn’t all appear as <code>. The <code> tag is closed between the first line and second line of text, thus making “Second paragraph text” appear as normal paragraph style rather than <code> style.

      It’s a minor glitch, but someone may want to address it.

    • <p> tags disappear when editing <code>
      The <p> tags disappeared from the first line of code in the post above. After I posted the comment, the text looked wrong. So I clicked the “Edit” link at the bottom of that post.

      In the edit page, the backticks were still there, but the <p> tags had been removed from the edit window.

    Yet another update:

    Two carriage returns do work after all. I guess I was dealing with a browser-cached copy of the page or something before. Sorry for the trouble.

    The glitches I mentioned in the post above are still relevant, though.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘<br /> used instead of <p>’ is closed to new replies.