I’m editing a child theme for bb-theme and am trying to change the Search Results title to read something different and add a class to separate “Search Results:” and the search term “%s.” I’m also trying to add a total results count below the title that reads: # Results. How can I achieve this? Just a note, I’m also using Themer Layouts for the search page.
I saw the following in bb-theme’s class-fl-theme.php and was wondering if there was a way to modify it in the child theme:
static public function archive_page_header() {
// Category
if ( is_category() ) {
$page_title = single_cat_title( '', false );
} elseif ( is_tag() ) {
/* translators: %s: Archive title tag */
$page_title = sprintf( _x( 'Posts Tagged ‘%s’', 'Archive title: tag.', 'fl-automator' ), single_tag_title( '', false ) );
} elseif ( is_day() ) { // Day
/* translators: %s: Archive title day */
$page_title = sprintf( _x( 'Archive for %s', 'Archive title: day.', 'fl-automator' ), get_the_date() );
} elseif ( is_month() ) { // Month
/* translators: %s: Archive title month */
$page_title = sprintf( _x( 'Archive for %s', 'Archive title: month.', 'fl-automator' ), single_month_title( ' ', false ) );
} elseif ( is_year() ) { // Year
/* translators: %s: Archive title year */
$page_title = sprintf( _x( 'Archive for %s', 'Archive title: year.', 'fl-automator' ), get_the_time( 'Y' ) );
} elseif ( is_author() ) { // Author
/* translators: %s: Archive title author */
$page_title = sprintf( _x( 'Posts by %s', 'Archive title: author.', 'fl-automator' ), get_the_author() );
} elseif ( is_search() ) { // Search
/* translators: %s: Search results title */
$page_title = sprintf( _x( 'Search results for: %s', 'Search results title.', 'fl-automator' ), get_search_query() );
} elseif ( isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ) { // Paged
$page_title = _x( 'Archives', 'Archive title: paged archive.', 'fl-automator' );
} else { // Index
$page_title = '';
}
if ( ! empty( $page_title ) ) {
include locate_template( 'includes/archive-header.php' );
}
}
I’ve tried just translating the header of the Search results page in my child theme’s functions.php using the solution in Changing Archive Page "Posts Tagged %s" - #3 by cosm44 and that didn’t seem to work.