WordPress.org

Ready to get started?Download WordPress

Forums

get_post not displaying formatted text (2 posts)

  1. sccr410
    Member
    Posted 6 years ago #

    I am using the following: http://codex.wordpress.org/Function_Reference/get_post

    When I output the post_content, it never contains any paragraph tags as it is supposed to. Is this an issue with the editor or the get_post function?

  2. Michael Fields
    Themer
    Posted 6 years ago #

    sccr410,

    Hi. You need to filter the content. Please try the following code:

    <?php
    $my_id = 7;
    $post_id_7 = get_post($my_id);
    $content = $post_id_7->post_content;
    $content = apply_filters( 'the_content', $content );
    print $content;
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic