functions - Change 'Categories' to 'Topics'

admin2025-06-05  1

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.

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

最新回复(0)