SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2011
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wordpress: Keep formatting of content

    Hello everyone,

    at the moment, I have a plugin called People Lists, and it really works great, because it was exactly what I was looking for.

    But, when I add my 'bio' to my profile, using simple formatting like this:

    Code:
    One line here.
    
    Some other line here.
    I have the 'line-break' between those 2 lines, but when it's echo'd out to the page, there is no 'formatting' of the next. It's just 1 line. Then I wanted to edit the plugin, to add the 'formatting' myself, but is there a way to do that in wordpress? Because what I can see, when you have line breaks in Wordpress, it doesn't store them in the DB. So I can't use nl2br() function in PHP.

    Hope any can help!

    best regards,
    Lucas R

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2005
    Posts
    1,849
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by zerpex View Post
    Because what I can see, when you have line breaks in Wordpress, it doesn't store them in the DB. So I can't use nl2br() function in PHP.
    Your best bet would be to find support from the creators of the plugin and see what can be done. The plugin is doing what it does separately from how Wordpress processes post content. Wordpress does store newlines in the database. I'm not sure what your plugin script is doing, if it is stripping newlines out before updating the database or just not doing anything with the newline characters on the way out.

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2011
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cheesedude View Post
    Your best bet would be to find support from the creators of the plugin and see what can be done. The plugin is doing what it does separately from how Wordpress processes post content. Wordpress does store newlines in the database. I'm not sure what your plugin script is doing, if it is stripping newlines out before updating the database or just not doing anything with the newline characters on the way out.
    Thank you a lot for the answer, I did use the wpautop() function around the output, and seems to work. Hopefully the plugin ain't updated that often!

    Best regards,
    Lucas R.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •