Print Post Content by Post id

Description

This code will print the content of any post based on the id. In this case the id is “175” simply change 175 to the post that you wish to target

This code will print the content of any post based on the id. In this case the id is “175” simply change 175 to the post that you wish to target

PHP Source Code

                        
                          <?php $my_postid = 175;//This is page id or post id
$content_post = get_post($my_postid);
$content = $content_post->post_content;
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;?>



<?php 
$id=175; 
$post = get_post($id); 
$content = apply_filters('the_content', $post->post_content); 
echo $content;  
?>                        
                        


Post Categories