bbpress change the word forum, topic, reply in the forum to another word I choose

bbpress

I would want to customize my Forum in bbpress. by changing/replacing the words that appear on the forum layout. I would like to change the words (everywhere they appear): Forum, topic, reply. To other words of my choice.

Does anyone have any way of doing this? I think I will need to make a child theme? anyone have any experience with such a problem?

Does anyone know what files name to edit for theme twenty eleven. and where they files are located?

Topic child-theme bbpress forum customization Wordpress

Category Web


You can hook to translation filters of Wordpress to change any word or phrase. These filters are: gettext, ngettext and gettext_with_context:

add_filter('gettext', 'change_bbpress_wording', 10, 3);
add_filter('ngettext', 'change_bbpress_wording', 10, 3);
add_filter('gettext_with_context', 'change_bbpress_wording', 10, 3);

function change_bbpress_wording ($translated, $untranslated, $domain) {

    if ($domain == 'bbpress') {

        $translated = str_ireplace('Forum', '*desired word*', $translated );
        $translated = str_ireplace('Topic', '*desired word*', $translated );
        $translated = str_ireplace('Reply', '*desired word*', $translated );

    }

    return $translated;
}

Note that we use str_ireplace which is case-insensitive, for case-sensitive replacement use str_replace instead.

See gettext filter hook codex page for more examples.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.