• Resolved boon_

    (@boon_)


    Simple really…

    Is there a way to use <?php echo $post->post_content; ?> so that it mimics <?php the_content(); ?> in the way it retains all the WYSIWYG formatting information (specifically, <p> tags)?

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter boon_

    (@boon_)

    Found it..

    <?php echo apply_filters(‘the_content’, $post->post_content); ?>

    Thanks for posting your solution there boon_ , you’ve just saved me some time!

    to me too… thanks!

    …and me – thanks!

    Sorry for the bump!

    I’m using the post_content for my pages because I’m working with columns:

    <?php
    $page_columns = explode ("[--column--]", $post->post_content);
    print $page_columns[0];
    print '<div class="column first">';
    print $page_columns[1];
    print '</div>';
    print'<div class="column second">';
    print $page_columns[2];
    print '</div>';
    ?>

    But… when I’m using this, there will be no paragraph tags.
    How do I use the pasted code above in combination with the <?php echo apply_filters('the_content', $post->post_content); ?>?

    (sorry for my bad English)

    Found it

    <?php
    $page_columns = explode ("[--column--]", $post->post_content);
    print apply_filters('the_content', $page_columns[0]);
    print '<div class="column first">';
    print apply_filters('the_content', $page_columns[1]);
    print '</div>';
    print'<div class="column second">';
    print apply_filters('the_content', $page_columns[2]);
    print '</div>';
    ?>

    Worked for me.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Post_content with formatting’ is closed to new replies.