Skip to content

Instantly share code, notes, and snippets.

@stuartjnelson
Created May 31, 2016 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuartjnelson/e7269db5daf376ae5abe20c37733d310 to your computer and use it in GitHub Desktop.
Save stuartjnelson/e7269db5daf376ae5abe20c37733d310 to your computer and use it in GitHub Desktop.
Getting `the_content()` from another post.
<?php
$my_postid = 12;//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(']]>', ']]&gt;', $content);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment