The article discusses how to remove the “CATEGORY ARCHIVES” text that appears in the Flatsome category section, which can be annoying for users. The author provides three methods to remove it: using a Filter Hook in the functions.php file, using CSS to hide the text, or editing the archive-title.php file in the Flatsome theme. By following these steps, users can effectively remove the “CATEGORY ARCHIVES” text from their WordPress website. It is recommended to clear the cache after making changes to ensure they are applied correctly.
How to Remove "CATEGORY ARCHIVES" on WordPress
Introduction:
Many users find the "CATEGORY ARCHIVES" label in the WordPress category section annoying and want to remove it for a better web experience. In this article, we will guide you on how to get rid of this label.
Methods to Remove "CATEGORY ARCHIVES":
1. Using Filter Hook to Delete CATEGORY ARCHIVES:
- Navigate to the theme and open the
functions.php
file located atmy-domain/wp-content/themes/flatsome-child
. - Copy the code below and paste it at the end of the file:
// Remove Category Title
function prefix_category_title( $title ) {
if ( is_category() ) {
$title = single_cat_title( '', false );
}
return $title;
}
add_filter( 'get_the_archive_title', 'prefix_category_title' );
2. Using CSS:
- Login to your WordPress admin panel, go to Appearance => Customize => Additional CSS and add the following code:
/* Remove CATEGORY ARCHIVES */
.blog-archive h1.page-title {
display: none;
}
3. Delete CATEGORY ARCHIVES in the Flatsome Theme:
- Access the following path on your host/VPS:
my-domain/wp-content/themes/flatsome/template-parts/posts/partials
- Open the
archive-title.php
file and delete the attached section as shown in the image. - You can also change it to another text if desired.
After completing the steps, make sure to clear the cache to see the changes reflected on your website successfully. Good luck with the removal process!