Category Archive Title
-
Hi all,
I do apologise for asking this, I know it’s been asked and answered a couple of times in this forum. The solution isn’t working for me and I can’t figure out the reasons as to why. I’m attempting to remove the term “Category Archive” from my archive pages. I have put the following into my child functions php yet it’s not removed the aforementioned term. Any guidance would be appreciated. And, again, sorry for asking something that’s already been solved for others previously….
<?php
function graphene_filter_gettext( $translated, $original, $domain ) {
$strings = array(
'Category Archive: <span>%s</span>' => '<span>%s</span>',
);
if ( ! empty( $strings[$original] ) ) {
$translations = &get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}
return $translated;
}
add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );
?>Kind Regards,
Sharon
Mod
Is this the entire contents of your child theme’s
functions.phpfile?Try changing the 3 to a higher number.
Moved to Support.
That’s got it. Many thanks again, Kenneth.
And, yup, that’s the entire contents of my .php file. I avoid touching it. Almost every time I do so, I manage to break my website. 😉
Cheers,
Sharon
Mod
FWIW, the 3 is the “precedence” that this function have. Increasing that number moves this function up in the hierarchy.
(That’s actually a terrible explanation, but I’m too tired at the moment to remember the proper explanation.)
Glad it worked for you.
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
