Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 Nov 1 '12 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 Nov 2 '12 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 Nov 2 '12 at 8:34
    
You have to make the theme. However you can find the reference files inside the plugins folder. –  Nicole Nov 2 '12 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 Nov 2 '12 at 13:01
add comment

1 Answer

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.

share|improve this answer
    
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 Nov 3 '12 at 11:07
    
Alway, always control the text domain, the third parameter for the callback function. Right now you will break many plugins. Explanation –  toscho Nov 10 '12 at 20:41
    
Just updated. was going to insert it from the beginning, but was not sure what the bbpress textdomain was –  Ahmad M Nov 10 '12 at 21:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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