• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

WP post echo not honoring line breaks

Explorer ,
Aug 16, 2012 Aug 16, 2012

Copy link to clipboard

Copied

I am using DreamWeaver server connections and Binding to echo back WordPress posts to certain divs on static pages and all is well including the css to style the echo. One BIG problem is that the echo does not honor line breaks. How can I maintain the line breaks?

TOPICS
Server side applications

Views

667

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2012 Aug 17, 2012

Copy link to clipboard

Copied

You'll have to insert them in the echo.

  

<?php echo $row_myPostsRS["postField"]. " </li>"; ?>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 18, 2012 Aug 18, 2012

Copy link to clipboard

Copied

LATEST

Rick, before I read your reply I noticed something I had not seen the the several other occassions I echoed a post to a static page. In the DW Binding Panel on the right hand side there was a notification that the 'post_content' was not formatted. Along with the notice under the format menu head there was a pull-down menu and I made the selection which indicated the insertion of line returns (sorry, the menu is no longer available in the Bindings Panel and I can not recall the exact name of the selection. When I went to the page code I see

' <p class="eventsPost_content"><?php echo nl2br($row_events['post_content']); ?></p>'

The nl2br and the parenthesis were added and the echo now has line breaks.

Any idea why I was prompted for a format selection? As I mentioned the few other echos I have tried went off without a hitch. Now that I think about it the content in the blog on the other occassions were typed and this last blog content was copied and pasted from a text editor. Any significance?

Thanks in advance

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines