Created
September 23, 2019 06:39
-
-
Save ivo-ivanov/4318b898e009dc457a91260e37a3b1a2 to your computer and use it in GitHub Desktop.
Display the post content for specific post ID outside the loop. #wordpress
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
// with post object by id | |
$post = get_post(12); // specific post ID | |
$the_content = apply_filters('the_content', $post->post_content); | |
if ( !empty($the_content) ) { | |
echo $the_content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment