• Hi all,

    I’ve made a script where I get all the posts from a category and display this posts, I’m not inside “the loop”. My posts contain gallery’s and when I display the post_content I see the gallery as plain text.

    $args = array(
        'category'  => '2',
        'orderby'   => 'post_date',
        'order'      => 'DESC'
    );
    $posts = get_posts($args);
    
    foreach ($posts as $post) {
        echo '<div class="content">' . $post->post_content.'</div>';
    }

    But I only want to display the real content, not the gallery in plain text as seen in this image.

    Someone who can help me out with this problem? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Gallery displayed as plain text in post_content’ is closed to new replies.