A General Technology & Development Blog

Technology, Development, Programming – Magento, Wordpress.

Home » 2 ways to remove “Category” text from archive title in WordPress

2 ways to remove “Category” text from archive title in WordPress

There are 2 ways to remove “Category” text from archive title in WordPress – particularly in later themes such as Twenty Seventeen.

This is a common issue that people are facing with modern themes in 2017.

Rather than your archive / category title looking like this:

Category: Blue Widgets

It can look like this:

Blue Widgets.

Method 1:

  1. Open archive.php in your theme or child theme.
  2. Look for the following code (around line 20):
    1. the_archive_title( ‘<h1 class=”page-title”>’, ‘</h1>’ );
  3. Replace this with the following code:
    1. single_term_title(‘<h1 class=”page-title”>’, ‘</h1>’);
  4. Upload and overwrite archive.php

Method 2:

  1. Open archive.php in your theme or child theme.
  2. Look for the following code (around line 20):
    1. the_archive_title( ‘<h1 class=”page-title”>’, ‘</h1>’ );
  3. Replace this with the following code:
    1. echo ‘<h1 class=”page-title”>’;single_cat_title();echo ‘</h1>’;
  4. Upload and overwrite archive.php

Remember to always backup your files before making changes so that you can restore it if something goes wrong.

  • Was this Helpful ?
  • Yes   No

Name of author

Name: BlogOwner

Short Bio: "The master has failed more times than the beginner has even tried."

eXTReMe Tracker