Use the_content outside the loop

If you are trying to do it for the current page you are on you can just use this:

global $post;
$content = $post->post_content;`

This will get the content for the current post instead of having to set the ID specifically.

Leave a Comment