I have moved a blog over to wordpress and I’ve used a lot of DOMDocument, xpath, regex and other methods to scrub the text.
This means that the_content();
is no longer the content and I’m using my own function ‘stripped_content();’ to echo out my stuff.
I have a plugin that looks for the_content();
and puts some social media buttons beneath it, but obviously my posts no longer use it.
So how can I make the_content();
my new content?
Add a filter to
the_content
and put your code in there so you don’t need your custom content function:You may need to adjust priority to run your filter before or after others: