Apologies non breaking space code not showing above. I use
I may have found the problem but I can’t understand why or what the solution is. In my functions.php I have the following…
// stop brackets in titles appearing on own line
function clean_orphan_titles($content){
$array = array (
'{ ' => '{ ',
' }' => ' }'
);
$content = strtr($content, $array);
return $content;
}
add_filter('the_title', 'clean_orphan_titles');
When I manually edit a title and add the
directly the plugin renders it fine but when the function does it the plugin doesn’t seem to like it. Can you offer any guidance? Like I say there were no issues with the previous version and no issues with titles in other widgets or plugins.
To clarify the array part hasn’t displayed properly it is…
'{ ' => '{&npsp;',
' }' => '&npsp;}'
Thank you.
I have discovered that if I replace return $content;
with return htmlspecialchars($content);
in my function the plugin output appears to render fine. The problem is the rest of my site then displays all the
– its a bit like they are operating opposite each other. Can you help – I looked at the plugin code but couldn’t really see what might need adapting.
Thank you Héctor.
Well unless something leaps out I think this can be ignored. I have manually edited my posts to remove the error. Seemed quickest way 🙂
Hi Paul, sorry for not replying earler. I’ve seen your other topics as well already.
Since you seem to have resolved the issue yourself, I’m marking this topic as fixed (unless you need further assistance with this, if so please feel free to mark it as unresolved again and post back so I can notice it).