admin管理员组文章数量:1026989
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?
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 edited Nov 3, 2012 at 11:24 user20509 asked Nov 1, 2012 at 6:19 user20509user20509 135 bronze badges 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
Reset to default 3You 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.
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?
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 edited Nov 3, 2012 at 11:24 user20509 asked Nov 1, 2012 at 6:19 user20509user20509 135 bronze badges 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
Reset to default 3You 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.
本文标签:
版权声明:本文标题:child theme - bbpress change the word forum, topic, reply in the forum to another word I choose 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745362224a2147468.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论