ok, so which method in
Step by step guide to setting up a bbPress forum – Part 1
item 3
are you using to display this page?
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
add_filter ('bbp_get_caps_for_role' , 'rew_change_caps', 10 , 2) ;
function rew_change_caps ($caps, $role) {
// Which role are we looking for?
switch ( $role ) {
case bbp_get_spectator_role() :
$caps = array(
// Primary caps
'spectate' => true,
'participate' => true,
// Forum caps
'read_private_forums' => true,
// Topic caps
'publish_topics' => true,
'edit_topics' => true,
// Reply caps
'publish_replies' => true,
'edit_replies' => true,
// Topic tag caps
'assign_topic_tags' => true,
);
break;
}
return $caps ;
}
Thank you for that Robin, I was able to find it in the theme coding based on your assistance.
if ( ! is_singular() ) {
$params = array(
'before' => sprintf(
'<h2 class="entry-title"%2$s><a href="%1$s" rel="bookmark">',
esc_url( get_permalink() ),
'microdata' === generate_get_schema_type() ? ' itemprop="headline"' : ''
),
'after' => '</a></h2>',
);
}
Do you know how I could exclude the forum link from this?
ok this is theme/page/wordpress setup rather than bbpress – if you look at the HTML then bbpress starts below this with
<div id="bbpress-forums" class="bbpress-wrapper">
above this – it is not bbpress doing it.
Thanks. I added it underneath the existing code and purged my cache but no difference. So I took the code out again.
Any other thoughts?
sorry, my brain was being fried – Visual is not standard but text is.
bbpress 2.6.7 and after has a bug
try and add this fix to your functions file
if( !function_exists( 'bbpress_browser_supports_js' ) ){
function bbpress_browser_supports_js() {
echo '<script>document.body.classList.remove("no-js");</script>';
}
add_action( 'wp_footer', 'bbpress_browser_supports_js' );
}
Thats a long story @robin-w.
I use “Advanced Editor Tools” to the main TinyMCE tool bar.
I have my own plugin that adds a couple of tweaks to the toolbar.
I have TinyMCE Config but that is for the TinyMCE behaviour.
I think I have some custom hooks too.
// ==============================================================
// Tweak MCE Toolbars (bbPress Editor)
function ajt_enable_visual_editor( $args = array() ) {
global $bsp_style_settings_form ;
$args['tinymce'] = true;
$args['teeny'] = false;
if ($bsp_style_settings_form['Show_editorsactivate'] == 1) $args['quicktags'] = false;
return $args;
}
add_filter( 'bbp_after_get_the_content_parse_args', 'ajt_enable_visual_editor' );
// ==============================================================
@robin I am experiencing the exact same issue, even when using ?ao_noptimize=1
to shut off Autoptimize for testing.
I also use GeneratePress (pro), and bbpress with bbpstylepack .
The individual forums show perfectly, but the index is very broken and missing proper styling.
The issue can be seen here https://www.budget101.com/community/
ok, it is a function in your child theme’s function file – line 28
Call to undefined function is_bbpress() in /home/storm/sites/wbc1-otiscreative-co-uk/public/wp-content/themes/Divi-Child-Theme/functions.php:28
So who had created that file? as either they or you will need to amend whatever that part of the file is trying to do.
Good morning,
In my forum they have the same capability but the Name group of two i needed. The forum is only one Part of my site.
Did you have an idea for the Code?
Thanks a lot
Hello,
I need that the spectator had the same capabilitys as a Participant.
Can anybody give a code for my functions.php
That were great.
Sorry for my English. I´m from Germany.
Regards
Hi!
To anyone in need of a login menu item with both user avatar and Link to the Bbpress dashboard in 2022, here’s my version of @robkk ‘s code :
add_filter('wp_nav_menu_items','rk_bbp_menu_profile_link', 10, 2);
function rk_bbp_menu_profile_link( $items, $args ) {
if( is_user_logged_in() && $args->theme_location == 'menu-1') {
$current_user = wp_get_current_user();
$user = $current_user->user_login ;
$avatar = get_avatar( $current_user->ID, 64 );
$items .= '<li class="NavBarLogin"><a href="/forums/users/' . $user . '/edit">' . $avatar . 'Mon compte</a></li>';
}
return $items;
}
I’ve got BuddyPress set up so that each group has one bbPress forum. I’d like to show a ‘Subscribe’ button in the group header on the group’s homepage which works exactly the same as the Subscribe button on the group’s forum page.
I’m using the code below to show the button, but it reloads the page instead of doing an AJAX call, and it doesn’t subscribe/unsubscribe the user from the group’s forum.
What do I need to do to get this working? The correct forum ID is being passed in the arguments.
$forum_ids = bbp_get_group_forum_ids();
if ( $forum_ids ) {
$sub_link_args = [ 'object_id' => reset( $forum_ids ) ];
bbp_forum_subscription_link( $sub_link_args );
}
I’ve enabled the full text editor, but it doesn’t use the editor styles I’ve created for the admin area.
Adding this:
add_filter( 'bbp_before_get_the_content_parse_args', 'u3aBBPEditorStylesheet' );
function u3aBBPEditorStylesheet( $args ) {
$args['tinymce'] = array( 'content-css' => get_stylesheet_directory_uri() . '/css/bothEditorStyles.css');
return $args;
);
replaces the editor with the HTML one. In the above setting $args[‘tinymce’] back to true brings the full text editor back. Any idea what I’m doing wrong?
Andy
Wait what…Version 1 ?! oh my! (facepalm)!
Thanks, Robin, for this. I’ll update bbpress on my site and run the code you’ve provided.
merci!
The link you showed is for version 1 of bbpress, which is no longer relevant.
changing the header is theme specific, you’d be looking at finding the header.php file in the theme, creating a child theme and then yu would use something like
is_bbpress()
in thee code to check if tis was a bbpress page
eg
if (is_bbpress()) {
?>
<div id="pg-70016-0" class="panel-grid panel-has-style" data-style="{"class":"banner row","background_image_attachment":false,"background_display":"tile","row_stretch":"full-stretched-padded","cell_alignment":"flex-start"}" data-ratio="1" data-ratio-direction="right">
<div class="banner row siteorigin-panels-stretch panel-row-style panel-row-style-for-70016-0" data-stretch-type="full-stretched-padded">
<div id="pgc-70016-0-0" class="panel-grid-cell" data-weight="1">
<div id="panel-70016-0-0-0" class="so-panel widget widget_custom_html panel-first-child panel-last-child" data-index="0" data-style="{"background_image_attachment":false,"background_display":"tile"}"><div class="textwidget custom-html-widget"><img alt="Herman" height="96" width="96" data-src="https://356259.smushcdn.com/255537/wp-content/uploads/learn-press-profile/1/bd882ec1e4a6fe8b6b83e4bb85be5c26.jpg?lossy=1&strip=1&webp=1" class="avatar avatar-96wp-user-avatar wp-user-avatar-96 photo lazyloaded" src="https://356259.smushcdn.com/255537/wp-content/uploads/learn-press-profile/1/bd882ec1e4a6fe8b6b83e4bb85be5c26.jpg?lossy=1&strip=1&webp=1"><noscript><img alt="Herman" src="https://356259.smushcdn.com/255537/wp-content/uploads/learn-press-profile/1/bd882ec1e4a6fe8b6b83e4bb85be5c26.jpg?lossy=1&strip=1&webp=1" class="avatar avatar-96wp-user-avatar wp-user-avatar-96 photo" height="96" width="96" /></noscript> <div class="pmpro_logged_in_welcome_wrap">
<h3 class="pmpro_member_display_name">
Welcome, <a href="https://frenchtasticpeople.com/membership-account/">Herman</a> </h3>
</div>
<div class="media-12 columns">
<h1 class="page-title">
Bonjour
</h1>
<div class="row">
<div class="media-10 small-12 media-offset-1 columns">
<p class="text-3x text-center">
<i class="fas fa-sync-alt"></i> Update your account easily <i class="fas fa-search"></i> Browse the entire course library <i class="far fa-hand-pointer"></i> Choose any lesson you want for free <br> <i class="fas fa-download"></i> Download resources <i class="fas fa-tools"></i> Practice your French skills in the lab <i class="fas fa-user-headset"></i> Get premium support
</p>
<div class="dashboard-quick-links">
Quick Nav Links:
<ul class="button-link-list">
<li class="quick-nav-item nav-item-1">
<a href="https://frenchtasticpeople.com/courses/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Course Library</a></li>
<li class="quick-nav-item nav-item-2">
<a href="https://frenchtasticpeople.com/user-profile/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Enrolled Courses</a></li>
<li class="quick-nav-item nav-item-3">
<a href="https://frenchtasticpeople.com/files/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Work Files</a></li>
<li class="quick-nav-item nav-item-4">
<a href="https://frenchtasticpeople.com/course-category/core-vocabulary/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Core Vocabulary</a></li>
<li class="quick-nav-item nav-item-5">
<a href="https://frenchtasticpeople.com/course-category/extended-french-vocabulary/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Extended Vocabulary</a></li>
<li class="quick-nav-item nav-item-6">
<a href="https://frenchtasticpeople.com/course-category/basic-french-vocabulary-videos/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Vocab Video Tutorials</a></li>
<li class="quick-nav-item nav-item-7">
<a href="https://frenchtasticpeople.com/course-category/french-grammar-glossary/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Grammar Glossary</a></li>
<li class="quick-nav-item nav-item-8">
<a href="https://frenchtasticpeople.com/course-category/free-french-grammar-course-challenge/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Grammar Bootcamp</a></li>
<li class="quick-nav-item nav-item-9">
<a href="https://frenchtasticpeople.com/course-category/most-used-french-verbs-part-1/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">French Verbs (1)</a></li>
<li class="quick-nav-item nav-item-10">
<a href="https://frenchtasticpeople.com/french-course-outlines" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Course syllabuses</a></li>
<li class="quick-nav-item nav-item-11">
<a href="https://frenchtasticpeople.com/french-course-guidelines/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Course Guidelines</a></li>
<li class="quick-nav-item nav-item-12">
<a href="https://frenchtasticpeople.com/buy-amazon-french-books/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Amazon</a></li>
<li class="quick-nav-item nav-item-13">
<a href="https://frenchtasticpeople.com/french-course-outlines" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Manage Account</a></li>
<li class="quick-nav-item nav-item-14">
<a href="https://frenchtasticpeople.com/french-course-guidelines/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Edit Profile</a></li>
<li class="quick-nav-item nav-item-15">
<a href="https://frenchtasticpeople.com/lab/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Practice Lab</a></li>
</ul>
</div>
</div>
</div>
</div></div></div>
</div>
</div>
</div>
<?php
}
Hi Robin,
I’m sad to report that the code provided had no effect on my site.
I inserted it Code Snippet but no effect.
screenshot of the part to be changed
I guess my real question is how to change theme/WP header on pages specifically displaying forum content? Some other participant here had something to say about it https://bbpress.org/forums/topic/wordpress-header-on-bbpress/ and claimed to have been successful (?)
Will you vouch for it as well or do you have have something else you can help me implement?
TIA
This should get you most of what you want
add_action( 'bbp_template_after_forums_index' , 'rew_add_extra_text' );
add_action( 'bbp_template_after_single_forum' , 'rew_add_extra_text' );
add_action( 'bbp_template_after_single_topic' , 'rew_add_extra_text' );
function rew_add_extra_text () {
?>
<div id="pg-70016-0" class="panel-grid panel-has-style" data-style="{"class":"banner row","background_image_attachment":false,"background_display":"tile","row_stretch":"full-stretched-padded","cell_alignment":"flex-start"}" data-ratio="1" data-ratio-direction="right">
<div class="banner row siteorigin-panels-stretch panel-row-style panel-row-style-for-70016-0" data-stretch-type="full-stretched-padded">
<div id="pgc-70016-0-0" class="panel-grid-cell" data-weight="1">
<div id="panel-70016-0-0-0" class="so-panel widget widget_custom_html panel-first-child panel-last-child" data-index="0" data-style="{"background_image_attachment":false,"background_display":"tile"}"><div class="textwidget custom-html-widget"><img alt="Herman" height="96" width="96" data-src="https://356259.smushcdn.com/255537/wp-content/uploads/learn-press-profile/1/bd882ec1e4a6fe8b6b83e4bb85be5c26.jpg?lossy=1&strip=1&webp=1" class="avatar avatar-96wp-user-avatar wp-user-avatar-96 photo lazyloaded" src="https://356259.smushcdn.com/255537/wp-content/uploads/learn-press-profile/1/bd882ec1e4a6fe8b6b83e4bb85be5c26.jpg?lossy=1&strip=1&webp=1"><noscript><img alt="Herman" src="https://356259.smushcdn.com/255537/wp-content/uploads/learn-press-profile/1/bd882ec1e4a6fe8b6b83e4bb85be5c26.jpg?lossy=1&strip=1&webp=1" class="avatar avatar-96wp-user-avatar wp-user-avatar-96 photo" height="96" width="96" /></noscript> <div class="pmpro_logged_in_welcome_wrap">
<h3 class="pmpro_member_display_name">
Welcome, <a href="https://frenchtasticpeople.com/membership-account/">Herman</a> </h3>
</div>
<div class="media-12 columns">
<h1 class="page-title">
Bonjour
</h1>
<div class="row">
<div class="media-10 small-12 media-offset-1 columns">
<p class="text-3x text-center">
<i class="fas fa-sync-alt"></i> Update your account easily <i class="fas fa-search"></i> Browse the entire course library <i class="far fa-hand-pointer"></i> Choose any lesson you want for free <br> <i class="fas fa-download"></i> Download resources <i class="fas fa-tools"></i> Practice your French skills in the lab <i class="fas fa-user-headset"></i> Get premium support
</p>
<div class="dashboard-quick-links">
Quick Nav Links:
<ul class="button-link-list">
<li class="quick-nav-item nav-item-1">
<a href="https://frenchtasticpeople.com/courses/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Course Library</a></li>
<li class="quick-nav-item nav-item-2">
<a href="https://frenchtasticpeople.com/user-profile/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Enrolled Courses</a></li>
<li class="quick-nav-item nav-item-3">
<a href="https://frenchtasticpeople.com/files/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Work Files</a></li>
<li class="quick-nav-item nav-item-4">
<a href="https://frenchtasticpeople.com/course-category/core-vocabulary/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Core Vocabulary</a></li>
<li class="quick-nav-item nav-item-5">
<a href="https://frenchtasticpeople.com/course-category/extended-french-vocabulary/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Extended Vocabulary</a></li>
<li class="quick-nav-item nav-item-6">
<a href="https://frenchtasticpeople.com/course-category/basic-french-vocabulary-videos/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Vocab Video Tutorials</a></li>
<li class="quick-nav-item nav-item-7">
<a href="https://frenchtasticpeople.com/course-category/french-grammar-glossary/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Grammar Glossary</a></li>
<li class="quick-nav-item nav-item-8">
<a href="https://frenchtasticpeople.com/course-category/free-french-grammar-course-challenge/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Grammar Bootcamp</a></li>
<li class="quick-nav-item nav-item-9">
<a href="https://frenchtasticpeople.com/course-category/most-used-french-verbs-part-1/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">French Verbs (1)</a></li>
<li class="quick-nav-item nav-item-10">
<a href="https://frenchtasticpeople.com/french-course-outlines" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Course syllabuses</a></li>
<li class="quick-nav-item nav-item-11">
<a href="https://frenchtasticpeople.com/french-course-guidelines/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Course Guidelines</a></li>
<li class="quick-nav-item nav-item-12">
<a href="https://frenchtasticpeople.com/buy-amazon-french-books/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Amazon</a></li>
<li class="quick-nav-item nav-item-13">
<a href="https://frenchtasticpeople.com/french-course-outlines" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Manage Account</a></li>
<li class="quick-nav-item nav-item-14">
<a href="https://frenchtasticpeople.com/french-course-guidelines/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Edit Profile</a></li>
<li class="quick-nav-item nav-item-15">
<a href="https://frenchtasticpeople.com/lab/" title="French courses that makes it easy for you to practice your French anytime, from anywhere and at a very affordable cost.">Practice Lab</a></li>
</ul>
</div>
</div>
</div>
</div></div></div>
</div>
</div>
</div>
<?php
}
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
You can manually change any set up already from their profile.
For new users you can change this at registration
eg
function change_display_name( $user_id ) {
$info = get_userdata( $user_id );
$args = array(
'ID' => $user_id,
'display_name' => $info->first_name . ' ' . $info->last_name
);
wp_update_user( $args );
}
add_action('user_register','change_display_name');
you have options of
‘display_name’ => $info->user_login
or
‘display_name’ => $info->user_email
or
‘display_name’ => $info->user_nicename
or if you have a custom field, you can use that
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
These posts all contained 2 links to my website, below the threshold for moderation trigger.)
The html code has tons of links in it – hence the moderation 🙂
put this in the custom css part of your theme
.bbp-forums-list {
display: none;
}
neither is standard in bbpress, maybe in buddypress or buddyboss, I don’t know.
for the handle, you’ll need to add
/**
* Add @mentionname after bbpress forum author details
*/
add_action( 'bbp_theme_after_reply_author_details', 'mentionname_to_bbpress' );
function mentionname_to_bbpress () {
$user = get_userdata( bbp_get_reply_author_id() );
if ( !empty( $user->user_nicename ) ) {
$user_nicename = $user->user_nicename;
echo "@".$user_nicename;
}
}
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
1. use this plugin
bbp style pack
dashboard>settings>bbp style pack>forum Display – item 11
or 2. using code
to set to say 60
add_filter ('bbp_before_has_forums_parse_args', 'rew_number_of_forums') ;#
function rew_number_of_forums ($args) {
$args['posts_per_page'] = 60 ;
return $args ;
}
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
Thank you Robin,
That is very helpful info.
As I work on this I will try to document using these from a coder’s perspective and share it back 🙂
Peace,
Jamie