categories - Set category page title in custom theme

admin2025-06-06  7

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 6 years ago.

Improve this question

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/

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 6 years ago.

Improve this question

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/

Share Improve this question edited Nov 12, 2018 at 17:01 Rohan Hapani asked Nov 12, 2018 at 16:53 Rohan HapaniRohan Hapani 1035 bronze badges 4
  • 1 Possible duplicate of Remove "Category:", "Tag:", "Author:" from the_archive_title – kero Commented Nov 12, 2018 at 16:57
  • It's programmatically. I don't know programming of wordpress. I need to setup from admin. – Rohan Hapani Commented Nov 12, 2018 at 16:59
  • @kero can you please help me how to solve it? I'm totally new in wordpress. – Rohan Hapani Commented 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 Commented Nov 12, 2018 at 17:09
Add a comment  | 

1 Answer 1

Reset to default 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/Functions_File_Explained

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749188699a317106.html

最新回复(0)