0

I'm new in wordpress. I am using one custom theme and install in wordpress.

I want to change category page title and remove "Category:" prefix from title. How can I manage it from admin ?

I don't know wordpress programming. So, I need to setup using admin panel.

Please guide me. Thanks !!

Page URL : http://localhost/tutorialsite/category/magento/magento-2/

enter image description here

4
  • 1
    Possible duplicate of Remove "Category:", "Tag:", "Author:" from the_archive_title
    – kero
    Nov 12, 2018 at 16:57
  • It's programmatically. I don't know programming of wordpress. I need to setup from admin. Nov 12, 2018 at 16:59
  • @kero can you please help me how to solve it? I'm totally new in wordpress. Nov 12, 2018 at 17:04
  • This is a programming community here (mostly). If you don't want to use custom code, I think yoast plugin can do this for you
    – kero
    Nov 12, 2018 at 17:09

1 Answer 1

1

In your functions.php of your theme file add the following code, taken from Remove "Category:", "Tag:", "Author:" from the_archive_title.

add_filter( 'get_the_archive_title', function ($title) {

    if ( is_category() ) {

            //being a category your new title should go here
            $title = single_cat_title( '', false );

        } elseif ( is_tag() ) {

            $title = single_tag_title( '', false );

        } elseif ( is_author() ) {

            $title = '<span class="vcard">' . get_the_author() . '</span>' ;

        }

    return $title;

});

Of course you need to read about how the functions.php works. https://codex.wordpress.org/Functions_File_Explained

5
  • Can you please tell me how to check active theme folder ? I use this theme => wordpress.org/themes/blog-way Nov 12, 2018 at 17:19
  • There are four folders in my wp-content/themes folder. blog-way/twentyfifteen/twentyseventeen/twentysixteen Nov 12, 2018 at 17:20
  • To see the active one you go to Appearance > Themes in your wp dashboard. Than you can go to Appearance > Editor and insert into the functions.php the code above. However, you should check the best practices to apply changes on your themes, before doing it.
    – middlelady
    Nov 12, 2018 at 17:23
  • 2
    The moment you update your theme this code will be gone. You should be using child themes for this or place the code inside a custom plugin
    – kero
    Nov 12, 2018 at 18:11
  • I completely agree with @kero.
    – middlelady
    Nov 12, 2018 at 18:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.