BEFORE
AFTER
A common question I get about the Extra Theme is how can the word “Category” be removed from category page title.
This can be done using the following PHP code:
function remove_category_text_from_archive_title($title) {
return is_category()?single_cat_title('', false):$title;
}
add_filter('get_the_archive_title', 'remove_category_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.
Really cool but I have a 500 error page when I add this code in my function.php page of my extra child template. Any idea ? is this code works only for Divi or did it work for extra too ?
Hi wolkam, sorry to hear this. The code was designed for Extra and should work when added to the functions.php file of your child template. Are you able to temporarily add this line to the wp-config.php file in your main WordPress folder?:
define( ‘WP_DEBUG’, true );
It will turn on error messages, so when you view the 500 error page it should print out the reason for the error. If you can let me know what it says I will hopefully be able to help you solve it. Thanks!
any code to remove tag similarly?
Hey vin, the code to do so is pretty similar. I’ve put it in its own post:
https://extrabooster.com/remove-the-word-tag-from-archive-pages/
I hope it helps!
Thank you, worked great!
Hi everyone, this works fine for me thanks, but I wonder how to remove all the title I mean category title (or tag) AND name of the category or tag. Any idea ? I work on this project and want to remove the title “Art history” on top: https://extra.judithbenhamouhuet.com/theme/art-history/
Thanks Elegant Theme for this information.
To remove text title of category, just add this in css :
.category #main-content #content-area > .et_pb_extra_column_main h1 {
display: none;
}
I’m glad ET were able to help you out, and thanks for sharing the solution, Xavier!
It still works in 2022… THANKS
Great! Thanks for the update, sash 🙂