thanks everyone
so yes, the plugin won’t work with Gutenberg, as it doesn’t use the same way to interact with metaboxes. I can write some code to do that, and I’ll take a look at what’s involved.
For those of you that aren’t using Gutenberg eg disabling or installing classic editor plugins, then as far as I can see it still works ok – does anyone have any issues with it ?
@bodybyloud – not sure if you are looking for an additional feature – ie automatically create a topic on post publishing, or if the existing functionality isn’t working for you – ca you come back with some further detail please.
Thanks for the interesting ideas!
I will try to code))
so you would set the default role in
dashboard>settings>forums to be ‘spectator’ and then wordpress login hook to wp-login or init
add_action('wp_login', 'xxx', 10, 2); which passes '$user_login, $user'
add_action('init', 'xxx');
your function then would check date current user registered, and if over a month, change the role to ‘participant’ using
bbp_set_user_role( $user_id, bbp_get_participant_role() );
I want to make a publication delay (for example 1 month) for newly registered users — as protecting against spam.
Is it possible without a plugin, using only code?
Where to dig? )
Thanks everyone! Found a solution in the bbpress codeх
Sadly when I use the following ccs code:
.bbp-form {
display: none;
}
the form also disappears from the custom page I made.
Just feels that this isn’t going to work for me and thus should look into alternative forum software.
Oh thanks. This is almost what I wanted.
But instead of
today – shown “no answers”
yesterday – “1 day ago”
…. where and that this changing?
What mean —between comma “,” and “ago”—- this code slice: .*[^ago]/’ ..?
You can remove everything between comma “,” and “ago” this way: (put in functions.php)
function short_time ($output) {
$output = preg_replace( '/, .*[^ago]/', ' ', $output );
echo $output;
}
add_action ('bbp_get_time_since', 'short_time') ;
you can try something like this:
function custom_logged_in_replies($posts){
if (!is_user_logged_in()){
$posts = null;
echo 'Login to see the replies';
}
return $posts;
}
add_filter('bbp_has_replies', 'custom_logged_in_replies');
this will display any topics which have no topic tags I think
add_shortcode ('empty-tags' , 'rew_empty_tags' ) ;
function rew_empty_tags () {
$args = array( 'post_type' => 'topic', 'posts_per_page' => -1 );
$loop = new WP_Query( $args );
$output = '' ;
while ( $loop->have_posts() ) : $loop->the_post();
$current_id = get_the_ID();
$topic_tags = bbp_get_topic_tag_names( $current_id );
if (empty ($topic_tags)) $output.= '<br>'.$current_id ;
endwhile;
return $output ;
}
create a private page and put the shortcode
[empty-tags] in it
the original function is in
bbpress/includes/common/template.php and starts on line 2227
line 2419 creates the breadcrumb and to hide you would hide class bbp-breadcrumb-forum
line 2478 is the best place to change what you want, you would use that filter and cycle though the breadcrumb array and amend or take out the forum one.
Sorry beyond my time availability to code this for you.
Hi –
Rather than using the default ‘forum’ page to display my forum, I am embedding the forum on a custom static page using a shortcode.
I’d like to update the breadcrumbs and either hide (preferred) the default forum name/URL, or, edit the forum URL. I doubt I can edit the URL, so I’m okay with hiding the URL and manually injecting the URL in my functions.php file using the arg [‘before’]. Unfortunately, I don’t see a way to hide the specific Forum from the breadcrumbs. See possible arguments here: https://github.com/ntwb/bbPress/blob/master/src/includes/common/template.php#L2277-L2303
Out of the box:
Home (/) » Forums (/forums) » Forum Title (/forums/forum/forum-title/) » Topic
Ideal:
Forum Title (/custom-page/) » Topic
Actual (based on code below):
Forum Title (/custom-page/) » Forum Title (/forums/forum/forum-title/) » Topic
Here is the code I’m using to make that happen. Looking for a way to hide that second Forum Title.
function custom_bbp_breadcrumb() {
$args['before'] ='<div class="bbp-breadcrumb"><p><a href="/custom-page/" class="bbp-breadcrumb-forum">Forum Title</a><span class="bbp-breadcrumb-sep"> » </span>';
$args['include_home'] = false;
$args['include_root'] = false;
return $args;
}
add_filter('bbp_before_get_breadcrumb_parse_args', 'custom_bbp_breadcrumb' );
@erich199 and @bodybyloud – I have now had a look at the code.
I’m presuming both of you are using wordpress with blocks (ie the newer block editor rather than the classic editor) in posts and pages – I can see that this would not allow you to add topics for posts to new (or amend existing).
But it would allow the display in posts for old ones.
Is this what you are seeing ?
If so I think I can help, if not – can you explain further what is not happening
Yes, I looked at it already. It’s alot of code and I cannot determine where the problem might be coming from. All of the files have the same timestamp however so the files are unchanged.
“This is also where to list garage/yard sales”
this is in a div
<div class="bbp-forum-content">This is also where to list garage/yard sales</div>
or am I misunderstanding ?
Thanks very much Robin!
…that suggestion to target #bbpress-forums worked!
I’m getting a crash course in why some people like Elementor and others don’t. I think I’m in the latter camp.
🙂
One final comment: I’m surprised that bbpress code is outputting text as important as the forum description without surrounding it in tags so that it could be specifically targeted by some css.
Thanks, the shortcode did the job.
[bsp-display-topic-index show=’5′ template =’short’]
Thanks!
Self-resolved.
I used bbp_is_single_forum() to specify a forum with forum ID:2 by using is_single( 2 ) instead of all forums.
Nice to meet you.
I am currently creating a bulletin board service and would like to display the text formatting in the topic creation form, and I am using the URL below as a reference.
https://bbp-customize.com/topic-form-template/
In this article, you say “The above code sets up a common format for all the forums, but you can also set up a separate format for each forum by splitting it up by forum ID”, but I don’t know how to split it up for each forum ID.
I’ve looked it up, but it doesn’t work and I’m stuck.
Specifically, I would like to know how to display the text formatting only for forum ID:2 when there are forums with forum ID:1 and forum ID:2.
Sorry this is a very rudimentary question, thank you for your help.
this might also improve things
#bbpress-forums {
font-family: "c", Sans-serif !important;
}
otherwise I see you have style pack installed, so work through the font sections and make them “Playfair Display”, Sans-serif
agree
on the title this might work
.post-285 h1.entry-title {
font-family: "Playfair Display", Sans-serif;
}
Hmmm… Thanks very much Robin…
Someone else implemented this website with elementor (free version) …I’ve never worked with Elementor before.
As best as I can tell, that post-26.css is a generated css file generated under uploads/elementor/css/post-26.css. Perhaps this is really an elementor question…
In view of the fact that I’m using a shortcode on a page to get my forum index to appear, I’m trying to figure out how to get the forum to appear on the page in a way that will leave me free to style the forum:
- As it is now the entire forum inherits the elementor styles. (I would need the header and footer from the elementor theme but wouldn’t want the elementor styling in the body where the forum bbPress shortcode is located)
- A separate problem is that, in at least some cases, it seems that the forum description text itself is not surrounded by any html tag at all so it seems that I would not be able to target it with a specific css selector …it could only inherit styling from an outer selector higher up the chain.
it is caused by this line
.elementor-kit-26 h1 {
font-family:"Playfair Display SC", Sans-serif;
}
in
post-26.css
related to elementor, so may be a setting in that or your theme.
In essence the Playfair Display SC font is all capitals
https://fonts.google.com/specimen/Playfair+Display+SC
so all your headings will be capitals
Hello,
I just installed bbpress on a new website. I have given descriptions (or subtitles) to some of the forums. On the forum index, these descriptions show up in all uppercase (And when I check the code in Firefox Inspector I can see that there isn’t even any styling tag around the descriptions).
I can’t figure out what the problem is. What is causing this and how should I fix it? Thanks for the help.
Patrick
ah, I see what you ae getting at – not sure how this site does it, but you can create a link to a page in your site and put
[bbp-topic-index] in that page – that will show the latest 15 topics
If you want better than that, then
bbp style pack
once activated go to
dashboard>settings>bbp style pack>shortcode
and check out the
[bsp-display-topic-index] which has lots of settings you can use to control what is shown
dashboard>settings>bbp style pack>Custom CSS