Skip to main content
added 102 characters in body
Source Link
GKS
  • 1.3k
  • 8
  • 12

You can use get_post_fieldget_post() function to get the post content by post id.

$post_id = 129;
if( get_post_status( $post_id ) == 'publish' ) {
    echo 
 get_post_field( 'post_content',  $post_content = get_post($post_id);
    $content = $post_content->post_content;
    echo apply_filters('the_content',$content);
}

You can use get_post_field() function to get the post content by post id.

$post_id = 129;
if( get_post_status( $post_id ) == 'publish' ) {
    echo get_post_field( 'post_content', $post_id );
}

You can use get_post() function to get the post content by post id.

$post_id = 129;
if( get_post_status( $post_id ) == 'publish' ) {
     
    $post_content = get_post($post_id);
    $content = $post_content->post_content;
    echo apply_filters('the_content',$content);
}
Code Formatting
Source Link
Howdy_McGee
  • 20.8k
  • 24
  • 91
  • 175

You can use get_post_field() function to get the post content by post id.

<?php
            $post_id = 129;
                if (get_post_status get_post_status( $post_id ) == 'publish' ) {
                    echo get_post_field( 'post_content', $post_id );;;
                }
            ?>

You can use get_post_field() function to get the post content by post id.

<?php
            $post_id = 129;
                if (get_post_status ( $post_id ) == 'publish') {
                    echo get_post_field('post_content', $post_id);;
                }
            ?>

You can use get_post_field() function to get the post content by post id.

$post_id = 129;
if( get_post_status( $post_id ) == 'publish' ) {
    echo get_post_field( 'post_content', $post_id );
}
Source Link
GKS
  • 1.3k
  • 8
  • 12

You can use get_post_field() function to get the post content by post id.

<?php
            $post_id = 129;
                if (get_post_status ( $post_id ) == 'publish') {
                    echo get_post_field('post_content', $post_id);;
                }
            ?>