AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Closed] Template override fail, m I doing it right?

2 Posts
2 Users
0 Reactions
1,904 Views
DarjeelingHills.Com
Posts: 85
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@darjeeling)
Estimable Member
Joined: 8 years ago
[#7249]

I was trying to override the template buddypress.php to change the text Forum from Buddypress Profile page. I tried adding as given below to override using child theme but I didn't see any changes. So am I doing it right?

I copied wpforo/wpf-includes/integration/buddypress.php

added this to wp-content/themes/onepress-child/wpforo/wpf-includes/integration/buddypress.php

I opened the file buddypress.php and chanced the word Forum in Line no 57 but still I don't see any changes.

 'name' => __( 'Community', 'wpforo' ),

Please let me know if there is other way of doing this.

Note: I tried changing this in WpForo files and works perfectly. When I try to override using child theme this fails to show up.


1 Reply
Sofy
Posts: 5774
 Sofy
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@sofy)
Support Team
Joined: 8 years ago

Hi @writetoyogen,

this cannot be reached by doing such customization. You should add the following code in your current active theme functions.php file:

Don't forget to change the red mark code before using.

function my_custom_buddypress_forum_menu_name($translation, $text, $domain){

    if( $domain == 'wpforo' ) {
        $backtrace = wp_debug_backtrace_summary();
        if( strpos(strtolower($backtrace), 'wpf_forums_component->setup_nav') !== false ){
            if( strtolower($text) == 'forums' ) $translation = 'Community';
        }
    }
    return $translation;
}

add_filter('gettext', 'my_custom_buddypress_forum_menu_name', 10, 3);


Share: