• Resolved Jellico

    (@catsfoto1se)


    Hi!

    I’m using the following shortcode:
    [su_post field="post_content" default="" before="" after="" post_id="" post_type="post" filter=""]

    And the post content is displayed without any linebreaks (new line) UNLESS I center the text.

    For example, a post with this text:

    Testing the status

    Breaking the line

    It’s raining outside

    Will be displayed like this:

    Testing the status Breaking the line It’s raining outside

    Now if I center the text in the editor, it will be correctly displayed.
    .. But it shouldn’t be necessary to center the text to get the break line to work correctly

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Vova

    (@gn_themes)

    Hi @catsfoto1se,

    try using the_content instead of post_content. Example:

    [su_post field="the_content"]
    
    Thread Starter Jellico

    (@catsfoto1se)

    @gn_themes Then it displays everything, including photos, I only want to display the text written in the textfield..

    Thread Starter Jellico

    (@catsfoto1se)

    Am I not correct @gn_themes, that post_content should show the text correctly even thou I don’t center it in the editor when writing?
    Since it displays correctly when the text is centered..

    Plugin Author Vova

    (@gn_themes)

    Hi @catsfoto1se,

    please create a page with three sections: shortcode without centering, shortcode with centering, and shortcode with the_content. Then post here all the shortcodes you used and a link to your page.

    Thank you.

    Thread Starter Jellico

    (@catsfoto1se)

    Hi @gn_themes, I’ve now created two post, one that has the text centered and one where nothing had been done (normal text).

    I have 3 displays on the pages, and it’s the middle one that are behaving strangely

    Normal text

    Text is centered..

    Plugin Author Vova

    (@gn_themes)

    Hi @catsfoto1se,

    please do the following.

    1. Use the following shortcode:

    [su_post field="post_content" filter="custom_filter_wpautop"]
    

    2. Add the following snippet to the end of the functions.php file of your theme:

    function custom_filter_wpautop( $value ) {
    	return wpautop( $value );
    }
    Thread Starter Jellico

    (@catsfoto1se)

    @gn_themes Thanx a lot!
    It worked!..

    ..after a while, I edited the functions.php in my child theme, but it didn’t work, so I tested and tested, for an hour, until I realised that I had temporary changed to the mother theme..

    ..ops!
    But when I corrected it it worked perfect!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Su_post post_content isn’t breaking the lines’ is closed to new replies.