Thanks, Michael. That worked perfectly!
I’m not starting a new topic, because this is also about modifying the Category Page header:
Is there a way to include the current user’s name in the header?
It was “Category: Screening Room”
Thanks to Michael, it now says “Screening Room”
Is there a way to have it say “Joey’s Screening Room” for username Joey?
I have tried several solutions but can’t find the right place/method in archive.php to add the username.
(The page I need help with is still: http://teamwonderreel.online/category/ws/
based on the code of the earlier suggested https://wordpress.stackexchange.com/questions/179585/remove-category-tag-author-from-the-archive-title
try replacing that code with (only targets the category archive):
add_filter( 'get_the_archive_title', function ($title) {
if ( is_category() ) {
$current_user = wp_get_current_user();
if ( ($current_user instanceof WP_User) ) {
$title = $current_user->display_name . '′s ' . single_cat_title( '', false );
} else {
$title = single_cat_title( '', false );
}
}
return $title;
});
https://codex.ww.wp.xz.cn/Function_Reference/wp_get_current_user
Michael, sorry for the delay in responding. This works perfectly and I never could have figured it out myself! Thanks for helping me build a nicely personalized site.