Find a content with post id in wordpress

The following example will show the content of post id 30

<?php

$postid = 63;//This is page id or post id
$post = get_post($postid);
$title = $post->post_title;
$content = $post->post_content;
$content = apply_filters(‘the_content’, $content);
$content = str_replace(‘]]>’, ‘]]>’, $content);

echo $title;

echo $content

?>

You can customize this with easily style.

<?php

$postid = 63;//This is page id or post id
$post = get_post($postid);
$title = $post->post_title;
$content = $post->post_content;
$content = apply_filters(‘the_content’, $content);
$content = str_replace(‘]]>’, ‘]]>’, $content);

echo “<h1>”.$title.”</h1>”;

echo “<p>”.$content.”</p>”;

?>

Share This Post

Post Comment