Change Archive Header text
-
Hello – I would like to know how to change the archive header text on my category pages. It says “post published in (name of category) – for example – “Posts published in World”. I just want it to say the single name of the category – like “World” for example.
In my Function php file it has ths:
// Filters the_archive_title() like this: “Category: Business” => “Business”
// the_archive_title() is used in content/archive-header.php
//———————————————————————————-
if ( ! function_exists( ‘ct_mission_news_modify_archive_titles’ ) ) {
function ct_mission_news_modify_archive_titles( $title ) {if ( is_category() ) {
$title = single_cat_title( ”, true );
} elseif ( is_tag() ) {
$title = single_tag_title( ”, false );
} elseif ( is_author() ) {
$title = get_the_author();
} elseif ( is_month() ) {
$title = single_month_title( ‘ ‘ );
}
// is_year() and is_day() neglected b/c there is no analogous function for retrieving the page titlereturn $title;
}
}
add_filter( ‘get_the_archive_title’, ‘ct_mission_news_modify_archive_titles’ );Is this where I need to make a change? If so could you tell me what to put in there and where to put it? YOu could just modify this code here and send it back to me if I have the right place.
The page I need help with: [log in to see the link]
- The topic ‘Change Archive Header text’ is closed to new replies.