WordPress.org

Ready to get started?Download WordPress

Forums

Post losing line breaks. (2 posts)

  1. artcoder
    Member
    Posted 6 years ago #

    I'm trying to display post number 54 outside of "The Loop" by using this code ...

    $educational_id = 54;
    $post_educational = get_post($educational_id);
    $educational_title = $post_educational->post_title;
    
    echo "<h1><a href='#'>$educational_title</a></h1>";
    $content_educational = $post_educational->post_content;
    $content_educational = str_replace(']]>', ']]>', $content_educational);
    echo $content_educational;

    But it does not look quite like my regular posts. The paragraphs are all running together as if it is missing the <p> tags.

    Is there an easier way to display a particular post outside of the loop?

  2. moshu
    Member
    Posted 6 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic