$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'); ?>functions - Change 'Categories' to 'Topics'|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)

functions - Change 'Categories' to 'Topics'

matteradmin9PV0评论

I'm trying to find a way of displaying 'Topics' rather than 'Categories' and so far not being very successful.

I tried this:

function translate_category($translated) { 


$translated = str_ireplace('Category', 'Topic', $translated);
  return $translated; 
}

function translate_categories($translated) { 
  $translated = str_ireplace('Categories', 'Topics', $translated);
  return $translated; 
}

But it doesn't seem to work. Any suggestions would be welcome.

I'm trying to find a way of displaying 'Topics' rather than 'Categories' and so far not being very successful.

I tried this:

function translate_category($translated) { 


$translated = str_ireplace('Category', 'Topic', $translated);
  return $translated; 
}

function translate_categories($translated) { 
  $translated = str_ireplace('Categories', 'Topics', $translated);
  return $translated; 
}

But it doesn't seem to work. Any suggestions would be welcome.

Share Improve this question edited Dec 1, 2018 at 10:51 Donald Jenkins asked Dec 1, 2018 at 10:26 Donald JenkinsDonald Jenkins 1035 bronze badges 8
  • not clear question for me – vikrant zilpe Commented Dec 1, 2018 at 10:28
  • I added a screenshot tomato the question clearer. – Donald Jenkins Commented Dec 1, 2018 at 10:51
  • this meta box heading? – vikrant zilpe Commented Dec 1, 2018 at 10:56
  • function replace_text($text) { $text1 = str_replace('Category', 'Topic', $text1); $text2 = str_replace('Categories', 'Topics', $text2); return $text; } add_filter('int', 'replace_text'); – vikrant zilpe Commented Dec 1, 2018 at 11:12
  • add this function.php file – vikrant zilpe Commented Dec 1, 2018 at 11:13
 |  Show 3 more comments

1 Answer 1

Reset to default 0

Changing category base prefix is quite simple in WordPress.

You need to visit Settings » Permalinks page and scroll down to the ‘Optional’ section.

Post a comment

comment list (0)

  1. No comments so far