The Extra Theme tag archive pages are given a title of the form “Tag: sometag”. If you’d like to remove the “Tag:” part and just leave the title as the actual name of your tag, this can be done using the following PHP code:
function remove_tag_text_from_archive_title($title) {
return is_tag()?single_tag_title('', false):$title;
}
add_filter('get_the_archive_title', 'remove_tag_text_from_archive_title');
This code can be added to the end of the functions.php file. Note that it is highly advisable to add it to the functions.php file of a child theme, rather than the Extra Theme itself, to avoid it being overwritten when Extra is updated.
Please also note that changes to PHP files can cause your site to break if done incorrectly. I suggest taking a site backup before attempting this change.
Thnks a ton for this, exactly as i requested. one more request, the category and the tag headings by default come to the left , is it possible to align them to the center, thnks again.
You’re very welcome, VIN. You can center the category / tag headings pretty easily with CSS. Try this:
Center align the archive titles in Extra
HI DAN,
where to put this, in style sheet or function php, and pl how to format it?
Hey vin, it won’t work in a stylesheet as it is PHP code, rather than CSS. There are a few ways you can add PHP, but the easiest is to put it into your functions.php file. This post explains in a bit more detail how to add PHP code. It’s written for Divi, but the exact same process applies to Extra:
https://divibooster.com/adding-php-code-to-the-divi-theme/
You shouldn’t need to do anything to format the code – just copy and paste it as-is. The main thing is to make sure you can restore the old version of the functions.php file if anything does go wrong.