Support » Fixing WordPress » get_the_content for meta tag not working

Viewing 5 replies - 1 through 5 (of 5 total)
  • Get_the_content() only works in the loop which is why it doesn’t work for you. there’s a way to do what you want, but I don’t have the answer handy. I’ll look it up when I get home.

    echo $post->post_content; will echo your post content. Keep in mind though, it’s raw out of the database (same as get_the_content()). If you want to apply the same filters that the_content() receives, follow the instructions in the codex:

    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);

    Wow, thanks for the reply.. Imma go test that out.

    Works like a charm. Thanks bro.

    No problem, glad to help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘get_the_content for meta tag not working’ is closed to new replies.