1

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?

5
  • What have you tried to do already? Have you looked at bbPress's child theme located in the plugin's folder? There you will find most your answers in regards to changing the forum template, style and custom wording.
    – Nicole
    Commented Nov 1, 2012 at 12:57
  • I would like to clarify is there a child theme already made or do I have to make one? and where do I find the forum template? what's the file called?
    – user20509
    Commented Nov 2, 2012 at 6:47
  • Hi nicole, I have created a child theme... but I don't know where the forum template is? Is there a file where I can change the forum variable, topic variable, to other words of my choice?
    – user20509
    Commented Nov 2, 2012 at 8:34
  • You have to make the theme. However you can find the reference files inside the plugins folder.
    – Nicole
    Commented Nov 2, 2012 at 12:54
  • do you by any chance know the name of the file? what am I looking for? what are the reference files? is there more than one file I need to edit?
    – user20509
    Commented Nov 2, 2012 at 13:01

1 Answer 1

3

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.

3
  • I was still wondering if there was anyone that knows what files and where they are that I need to edit to change the words to what I like and customize the forum
    – user20509
    Commented Nov 3, 2012 at 11:07
  • Alway, always control the text domain, the third parameter for the callback function. Right now you will break many plugins. Explanation
    – fuxia
    Commented Nov 10, 2012 at 20:41
  • Just updated. was going to insert it from the beginning, but was not sure what the bbpress textdomain was
    – Ahmad M
    Commented Nov 10, 2012 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.