Created
December 21, 2023 22:35
-
-
Save metinsaylan/6414d5d58800902a3d9043652fd467e9 to your computer and use it in GitHub Desktop.
Get WordPress Post Content by Post 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
<?php | |
$post_id = 123; // Replace with the actual Post ID | |
$post = get_post( $post_id ); | |
if ( $post ) { | |
$post_content = apply_filters( 'the_content', $post->post_content ); | |
echo $post_content; | |
} else { | |
echo 'Post not found'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment