-
-
Save kimtrien/87d6443b2dee9a075dc254bc948e963c to your computer and use it in GitHub Desktop.
WordPress: get post content by ID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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