• I have looked over results on Google and elsewhere, and I can find no answer, so I’m bringing it here.

    I want to change “category” to “topic,” but the problem is that when I use that structure, it still shows “Category:” in the category search results.

    I have looked through the .php pages, but I cannot find where to modify that, so I need help. Thanks in advance!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You wish to change the “Category:” portion of the page’s title? The solution depends on how that came to be there in the first place, which depends upon your theme. That style of title looks like that of the_archive_title(). If that is indeed what your theme uses for this, you can alter the title any way you see fit through the ‘get_the_archive_title’ filter.

    Using filters like that does require a small amount of PHP coding to find “Category:” in the title and replace it with “Topic:” (or whatever you prefer). There are snippet plugins that allow you to add custom PHP code, but actually creating your own custom plugin to contain your PHP code is not as difficult as it may sound; it’s mainly a matter of placing a properly formatted text file in the right place on your server.

    Because “Category:” as used by the_archive_title() passes through the gettext translation scheme, you could instead use the “gettext” filter to watch for that particular text and change it as desired. Does not require changing to a different language though that’s the intent of the filter. Any arbitrary text will do. The advantage of the “gettext” filter is it’ll affect all instances of “Category:” on your site. “get_the_archive_title” filter would only affect usage of the related function.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.