• Resolved chaug

    (@chaug)


    My List content field looks like this:

    <p><h2><a href="[post_permalink]">[post_title]</a></h2></p>
    <p>[post_content]</p>
    <p></p>

    My problem is that [post_content] does not seem to preserver paragraphs. All content is displayed in a single paragraph. Other formatting is preserved.

    How can I preserve the paragraphs too?

    Thank you in advance.

    Christoph

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author EkoJR

    (@ekojr)

    Chances are, it’s not APL, but it’s WP. I’ve ran into a similar issue multiple times when adding posts with a similar format, and wp_query also seems to have some formatting of it’s own.

    Is this a new issue from an update?

    To correct the issue, try adding a class name to the elements, or a simple style attribute.

    Thread Starter chaug

    (@chaug)

    No, I don’t think this is related to an update.

    Unfortunately, there are too many posts for me to add a class name to elements in each post. So that is not a solution. I can also say that there is a piece of text in bold in each post and advanced post list displays that correctly. It seems to be only the paragraphs that it eats up.

    Plugin Author EkoJR

    (@ekojr)

    If it is in APL’s Preset->List Content, then you should be able to just change that, instead of every post. For example…

    <p class="any-name"><h2><a href="[post_permalink]">[post_title]</a></h2></p>
    <p class="any-name">[post_content]</p>
    <p class="any-name"></p>

    You don’t have to have any CSS styling. This just prevents WordPress from seeing an un-used HTML element, and removing it (even if there is a JS function to add content).

    • This reply was modified 7 years, 9 months ago by EkoJR.
    Plugin Author EkoJR

    (@ekojr)

    If that doesn’t work.

    I’ve also had instances where I’ve had to use <div> instead of <p>.

    Thread Starter chaug

    (@chaug)

    Stupid me, I didn’t grasp what you were saying the first time.

    But unfortunately, neither your example with <p> and class works nor when I replace <p></p> with <div></div>

    Plugin Author EkoJR

    (@ekojr)

    Looks like I may need to debug when I get the chance.

    I suspect it may be part of the encoding function that I recently added. Which is why I was wondering if it was a new issue, but won’t know for sure until I inspect it.

    Thread Starter chaug

    (@chaug)

    About the update question: It’s possible because I installed the plugin a few weeks ago but only really started using it now. So I don’t know if it worked before.
    Good luck with the debugging.

    Plugin Author EkoJR

    (@ekojr)

    Hmm, looks like I was wrong. I never did add any encoding, but excerpts shortcode does IF no excerpt is found. APL uses WP_Post->post_content directly with the [post_content] shortcode.

    The problem has to be with WP, and/or possible how it’s being used. WP does have some pre-formating functions built-in.

    Thread Starter chaug

    (@chaug)

    Are you using the_content to get the content of a post? I am not a programmer, but from what I understood the_content in WP should give you the raw content of the post, including all formatting whereas get_the_content() will not. (see here: https://rezzz.com/wordpress-tip-the_content-vs-get_the_content/)

    Thread Starter chaug

    (@chaug)

    Are you using the_content to get the content of the post? I’m not a programmer but from what I understand, the_content should give you the rwa content of the post while get_the_content doesn’t. See here: https://rezzz.com/wordpress-tip-the_content-vs-get_the_content/

    Thread Starter chaug

    (@chaug)

    I am trying to reply to your post but my reply is not showing up. And when I try to post the same again, it is telling me that it’s a duplicate. Not sure what’s going on. So here is one last try:

    Are you using the_content to get the content of the post? I’m not a programmer but from what I understand, the_content should give you the rwa content of the post while get_the_content doesn’t. See here: https://rezzz.com/wordpress-tip-the_content-vs-get_the_content/

    Thread Starter chaug

    (@chaug)

    I am trying to reply to your post but my reply is not showing up. And when I try to post the same again, it is telling me that it’s a duplicate. This is driving me nuts. There seems to be no way to respond to this topc. :-(((

    Thread Starter chaug

    (@chaug)

    Finally, it went through, so let me try again with what I originally wanted to say:

    Are you using the_content to get the content of the post? I’m not a programmer but from what I understand, the_content should give you the rwa content of the post while get_the_content doesn’t. See here: https://rezzz.com/wordpress-tip-the_content-vs-get_the_content/

    Thread Starter chaug

    (@chaug)

    Maybe it’s because I’m posting a link? This would be insane because it could at least state what the heck is going on.

    Are you using the_content to get the content of the post? I’m not a programmer but from what I understand, the_content should give you the rwa content of the post while get_the_content doesn’t. See here: ***link deleted***

    Plugin Author EkoJR

    (@ekojr)

    Yea, the WP forums have seen better days.

    APL doesn’t use the_content function, it uses the object variable from WP_Post->post_content. It grabs the content directly.

    However, WP has been know to do a little formatting of its own. Simply switching from Text to Visual when Adding a Post will mess up all the raw editing.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘How to preserve paragraphs in post content’ is closed to new replies.