1

There is the_content() in one of the template files which, well, prints the content. I get the content with get_the_content() manipulate it and print it.

However, I couldn't figure out which action or filter to use to prevent the_content() being called in the template file (single-post.php). I do have child template, but for some reasons, I don't want to manipulate the template file for single posts.

1 Answer 1

2

If you look at the codex (here) you'll see that the_content() is just a wrapper for get_the_content() which passes it through the the_content filter. So, you too can hook into that filter to change your content output without having to edit the theme files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.