$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>categories - Set category page title in custom theme|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

categories - Set category page title in custom theme

matteradmin9PV0评论
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

Post a comment

comment list (0)

  1. No comments so far