Skip to content

Instantly share code, notes, and snippets.

@agronom81
Last active January 27, 2016 10:00
Show Gist options
  • Save agronom81/b63d8077ed89e501c3f3 to your computer and use it in GitHub Desktop.
Save agronom81/b63d8077ed89e501c3f3 to your computer and use it in GitHub Desktop.
get the_content with ID
// Setting the Post ID in a variable for which the content is required
$the_postid = 20;
$the_post_content = get_post($the_postid);
$content = $the_post_content->post_content;
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
// Print Content data or further use it as required
echo $content;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment