Removing "Protected:" from password protected pages
-
Hi. The information on wprecipes.com states:
“The only thing you have to do is to paste the following piece of code in your functions.php file. Once you’ll save the file, the hack will be applied to your your posts.”
function the_title_trim($title) { $title = attribute_escape($title); $findthese = array( '#Protected:#', '#Private:#' ); $replacewith = array( '', // What to replace "Protected:" with '' // What to replace "Private:" with ); $title = preg_replace($findthese, $replacewith, $title); return $title; } add_filter('the_title', 'the_title_trim');
I am not understanding where to put the add_filter(‘the_title’, ‘the_title_trim’);
Copying and pasting throws an error on my site, but when I remove that last line, (add_filter…”) the error is not thrown, but the “Protected” is still visible, so it obviously needs to be included.
Any insight on this is greatly appreciated.
Thanks,
John
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Removing "Protected:" from password protected pages’ is closed to new replies.