0

WP is using TinyMCE as a WYSiWYG editor. So why then is WP ignoring my line breaks?
I really shouldn't have to do: echo wpautop( $some_long_text );

enter image description here

(large picture: http://prntscr.com/4re6xv)

Here is my custom code. I've added wpautop in order to get line breaks. But I shouldn't have to, should I?

// Get tile / content based on selected language

function getContent(){
    global $lang;
    global $post;

    if($lang == 'no') {
        return get_the_content();
    } else {
        return get_custom_field('content_en',$post->ID);
    }
}

function theContent(){
    $content = getContent();
    echo wpautop($content);
}
  • Have you tried "the_content()" instead of theContent() ? – Medardaosa Sep 29 '14 at 11:20
  • It's my own function due to language. I'll add the code. – Steven Sep 29 '14 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.