The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Post losing line breaks. (2 posts)

  1. artcoder
    Posted 8 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
    Posted 8 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic