Answer by Bryan Willis for How to use str_replace() outside the loop?
It's probably unorthodox/unnecessary if you can change the templates, but under certain conditions it might be necessary. I realize this is an old post but just came across it and realized I actually...
View ArticleAnswer by bbeeman for How to use str_replace() outside the loop?
Also, from a purely PHP point of view, the function str_replace returns a new string, and should be assigned to a different string variable. The examples are like below. See the PHP manual.function...
View ArticleAnswer by Rarst for How to use str_replace() outside the loop?
Filters don't really affect resulting markup. More precisely they affect anything that is passed through them, in this specific case output of the_content() function is passed through the_content...
View ArticleHow to use str_replace() outside the loop?
Is there any way to use str_replace() in Wordpress outside the loop?I want to change my html markup which starts before the loop.I need something like this:function content_magic($content) {...
View Article