This is the code I use, and the result i s blank:
$postID = 15;
$thePost = get_post($postID);
echo $thePost->post_content;
If I change post_content to post_title, it ouputs the title.
This is the code I use, and the result i s blank:
$postID = 15;
$thePost = get_post($postID);
echo $thePost->post_content;
If I change post_content to post_title, it ouputs the title.
do a var_dump to see what is going on
$postID = 15;
$thePost = get_post($postID);
echo $thePost->post_content;
var_dump($thePost);
your original code worked for me:
$postID = 2;
$thePost = get_post($postID);
echo $thePost->post_content;
but instead of calling up post 2, it called up page 2. i give my posts slug names; is there a way to call up by post name instead of postID?
This topic has been closed to new replies.