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>”;

?>


To seek challenging roles and to achieve excellence in the field of Open Source Web Technology with a profound spirit of commitment and dedication.

Share This Post

Related Articles

© 2017 Sumit Bansal. All rights reserved. Site Admin · Entries RSS · Comments RSS
Powered by WordPress · Designed by Theme Junkie