Hello,
I have a page, where I wanted to use shortcode [bbp-single-topic id=$topic_id]. I expected that only lead topic appears, but it does not. There is a lead topic with all replies.
Is there any way how to display Lead topic only (no replies)?
Thank you for any peply… Peter
PS: I tried to use <?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?> but I did not find out how to use it with specific topic_id….
Hello,
I have a page, where I wanted to use shortcode [bbp-single-topic id=$topic_id]. I expected that only lead topic appears, but it does not. There is a lead topic with all replies.
Is there any way how to display Lead topic only (no replies).
Thank you for any peply… Peter
PS: I tried to use <?php bbp_get_template_part( ‘content’, ‘single-topic-lead’ ); ?> but I did not find out how to use it with specific topic_id….
Sorry, that page doesn't exist!
The “Forums” page lists all the topics – not the Forums, is that normal?
It is if you set in Settings > FOrums for the forum root to display topics by freshness.
Using that shortcode can work too I guess.
It might be better to create a bbpress.php instead of a regular static WordPress page, because that 1 static page will not work for all of the bbPress pages. If you create a bbpress.php, all your bbPress pages will use that template instead.
See if this guide helps you any.
Getting Started in Modifying the Main bbPress Template
Since you using shortcodes you can echo the shortcodes in the bbPRess template like this.
<?php echo do_shortcode("[shortcode]"); ?>
@leirof
Add this anywhere you can put custom css like in your themes style.css file or in a custom css plugin.
#bbpress-forums div.bbp-the-content-wrapper input{
color: #000;
}
Can you see the forums on the frontend of your site??
Are you saying you cannot see it in the backend in Forums > All FOrums??
While testing your theme everything works fine for me.
You can try some troubleshooting to see if this is hopefully not a cache issue, or see if a plugin is causing the conflict, or if running the repair tools in Tools > Forums helps.
Troubleshooting
Try this php code snippet. Add it to your child themes functions.php file or in a functionality plugin that can hold custom php code snipppets.
add_filter ('bbp_get_title_max_length','rkk_change_title') ;
Function rkk_change_title ($default) {
$default=90 ;
return $default ;
}
Are you talking about where it says something similar to this in the body class. Most themes add this not really bbPress itself. If you are missing this <?php body_class(); ?> in your theme you not be able to see the post id.
postid-652
Or for the topic list of the forum where it shows this.
bbp-forum-652
If you have been heavily editing bbPress templates in your child theme you may not have this in correctly in loop-single-forum.
<ul id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>
Adapt the ’20px’ to the size you want:
.bbp-forum-title {
font-size: 20px;
}
PS. ne jamais dire ‘last question’… you never know what comes up next 🙂
sorry to bump such a old topic, but can someone show the specifc code to add to child theme functions.php? still learning here…
I tried adding this to functions, but produced an error…
function bbp_title_max_length( $default = 90 ) {
echo bbp_get_title_max_length( $default );
}
/**
* Return the maximum length of a title
*
* @since bbPress (r3246)
* @param $default bool Optional. Default value 90
* @uses get_option() To get the maximum title length
* @return int Is anonymous posting allowed?
*/
function bbp_get_title_max_length( $default = 90 ) {
return (int) apply_filters( 'bbp_get_title_max_length', (int) get_option( '_bbp_title_max_length', $default ) );
}
thx!
OOOPS! THAT PAGE CAN NOT BE FOUND
Encore ? :-p
.bbp-footer {
display: none;
}
Pascal.
If you inspect the body tag of this website in this/the “request and feedback” forum page, you can see that the id number for the forum is 652. If you go to any topic in this “request and feedback” forum and inspect the code in there, you can see that there is a number, 652, identifying that the topic is posted in the “request and feedback” forum.
Basically, I want to add the forum id number class to the <body> depending on the forum, or the topic that is posted in that forum.
Example, <body class=”[forum_id_number]”>.
For the avator, it will be something like this to add as CSS somewhere:
.bbp-author-avatar .avatar-14 {
width: 30px;
}
A+
Hi,
I forgot to check the box that says “notify me of follow ups,”
See to the left of these message, probably the 6th option. You can (un)subscribe by just clicking there 🙂
but then duplicates that post as the first reply
The only thing I can think of is another plugin or some code you added in a child theme or functions.php file. Did you try to deactivate other plugins to see it you still had the issue ?
Pascal.
Oops, I copy/pasted but forgot to edit the line. This is the correct one for anyone else trying to do this in the future:
$mykeymasters = get_users( array('role' => 'bbp_keymaster') );
Ah! The difference was the bbp_keymaster instead of the keymaster. This worked for me:
$mykeymasters = get_users( array('role' => 'keymaster') );
Thanks Pascal! You really helped me out here 🙂
Euh, yes of course.
Can this help you then ?
$user_query_full = new WP_User_Query( array( 'role' => 'bbp_keymaster' ) );
$user_query = $user_query_full->get_results();
var_dump( $user_query );
Pascal.
Ah ok,
Then how about:
$mykeymasters = get_users( array('role' => 'keymaster') );
https://codex.wordpress.org/Function_Reference/get_users
Pascal.
Thanks Pascal,
I’m actually making a shortcode to format a list of users that have the earlier mentioned roles. This shortcode will be used on a page for the front-end.
It’s basically a list of site staff members.
I’ve figured out the answer to my own question.
This field is related to the buddy press field wp_bp_activity. That shows something like “joe user replied to the topic xxx in the forum xxx”
_bbp_activity_id isn’t necessary for my reply to code on my particular site for bbpress to work properly. It IS however necessary if I want my Buddy Press integration to reflect activity updates related to the forum.
Hi,
this is in WP 4.3.1 GeneratePress child theme.
So far I have managed to display forum indices, topics, registration, login on actual WP pages so they can easily be designed and targeted through regular hyperlinks and menus. I used plugins like bbp StylePack and CleanLogin for this, plus the bbp shortcodes on the concerned pages.
Now there is at least one loophole that renders everything useless. e.g. when submitting a new topic the system jumps to “Topic” view where my page style settings are ignored. Is there sth like a template for the display of topics?
Also isn’t there a list of shortcodes somewhere that show ALL attribute options, too? The bbp codex https://codex.bbpress.org/features/shortcodes/ lists only the codes, without options.
Hi,
I am aware of snippets of code that exist, but they seem to have some small issues. What plugin are you referring to ?
Pascal.
Hi Ben,
It seems to be a known issue, but not bbPress related. Bug tickets have already been opened and closed for this because the issue is coming from other plugins.
You can read more here: https://codex.bbpress.org/bbp_setup_current_user/was-called-incorrectly/
But please let this not refrain you in posting here the issues you see or open a trac debug ticket yourself. It’s better to have it twice then not at all.
Pascal.