Skip to content

Instantly share code, notes, and snippets.

@kimtrien
Forked from ihorvorotnov/wp-get-content
Created June 7, 2016 03:27
Show Gist options
  • Save kimtrien/87d6443b2dee9a075dc254bc948e963c to your computer and use it in GitHub Desktop.
Save kimtrien/87d6443b2dee9a075dc254bc948e963c to your computer and use it in GitHub Desktop.
WordPress: get post content by ID
/**
* You often need to get the content or title from a specific post.
* Sometimes, using a custom loop is the better option, but when you only need
* to get information from a specific post, there’s a better option
*/
echo get_post_field('post_content', $post_id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment