• I have been using the Display Posts plugin for years and recently found a quirk that I cannot explain. I’m not sure anyone else has reported it and if there is a fix. On my home page I use the following shortcode:

    [display-posts posts_per_page="20" category="announcements" image_size="thumbnail" wrapper="div" include_content="true" include_link="false"]

    This was working fine for me in Classic Editor, but I recently converted my home page to Block Editor. Now the first post on the page does not preserve line breaks and it just all runs together in one line unless I manually add <br> or <p> tags to indicate where the line breaks should be. (This is not a problem for me to do, but it is hard to explain to non-technical staff who are expected to edit their own websites.)

    -When I use that same shortcode on a different page in Classic Editor it works just fine.
    -It is always a problem with the top post on the home page, no matter what that post is. The 2nd, 3rd, 4th posts are always fine, even if I add a new post to the top, the the 1st post moves to the 2nd position and is fine.
    -I tried using a “Classic Block” instead of a “Shortcode Block” but I still have the problem.
    -I tried previewing my page in a different theme (Twenty Twenty) and I still have the problem.
    -I made sure I am using straight quotes in my shortcode, not curly quotes.

    I am not really sure at this point if it is a core WordPress Block Editor issue or with the Display Posts plugin. I am running WordPress 5.4.2 and Display Posts 3.0.2.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter wellesleyps

    (@wellesleyps)

    I have done more testing and have some more information so you can easily replicate the issue. The line break issue only appears under the following conditions:

    -The page is created in Block Editor (not Classic Editor).
    -The display-posts shortcode is within a Column Block.
    -The post is the first post in the display-posts list.
    -Sample page with the issue: https://wellesleyps.org/display-posts-test-page/

    So far I have not found a CSS workaround, I am just continuing to manually add <br> or <p> tags to the first post on the page so that it has line breaks in the right places. I can only guess that something in the Display Posts plugin conflicts with the WordPress Column Block.

    The first post line break problem happens with all custom CSS removed. The problem also happens with the default WordPress Twenty Twenty theme.

Viewing 1 replies (of 1 total)
  • The topic ‘Line breaks not preserved on first post in block editor’ is closed to new replies.