found this code, add this to your function.php in your child theme
function custom_bbp_has_replies() {
$args['order'] = 'DESC'; // 'ASC' (Ascending, Default), 'DESC' (Descending)
return $args;
}
add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );
@robin-w the code doesnt work for me
untested but the following bar typos should work – add to your functions file
function role_show () {
$role = bbp_get_user_role( $user_id );
if ( bbp_is_user_keymaster() ||$role == 'bbp_moderator') $args['show_role'] = true ;
else $args['show_role'] = false ;
return $args ;
}
add_filter ('bbp_before_get_reply_author_link_parse_args', 'role_show' ) ;
ok, after the line
<?php do_atomic( ‘after_main’ ); // oxygen_after_main ?>
add
<?php get_sidebar( ‘subsidiary’ ); // Loads the sidebar-subsidiary.php template. ?>
i want to only display user role on keymaster and moderators users.
I dont want every participant to have the role shown , only the keymaster and moderators are important enough to me to show their role next to their avatar.
How would i do that??
im just using this code to display the users role
<div class=reply-author-role><?php bbp_reply_author_link( array( 'show_role' => true, 'type' => 'role' ) ); ?></div>
Cheers for the response. Figured out a simple way to handle it.
When I register the CPTs i just need to define exclude_from_search' => true for the CPTs I don’t want to appear in the WP search, then i dont need to run the above filter and BBP looks after itself.
Things look correct now, did you fix this?
If not please give specific links to show what your issue is, you have too many topics and forums for me to guess which one you are talking about.
Have you run any of the repair tools to see if they fix the issue?
https://codex.bbpress.org/repair-forums/
Also, WordPress doesn’t support multiple timzezones for users so this is not included with bbPress for that reason, they appears to be a few plugins that might be able to do this though I haven’t seen any that are compatible with bbPress, but you could have a look yourself.
https://wordpress.org/plugins/
My site is running mainly CPTs but I filter my search results to a subset of these using this technique:
function filter_search($query) {
if ($query->is_search) {
$query->set('post_type', array('A','B', 'C'));
};
return $query;
};
add_filter('pre_get_posts', 'filter_search');
which works fine for wordpress but when I search within BBP i get the ‘Oh bother! No search results were found here!’ message as you’d expect because of the above filter.
If i remove the filter the BBP search works fine, and if I add ‘forum’, ‘topic’, ‘reply’ to the above filter BBP search works fine, but the problem is get I the forum results appearing in the main search results page.
Also, If i remove the filter all together I still get forum results appearing in the main results page.
Is there a way to exclude forums results from appearing in the main search?
@joejozwowski @robin-w i think stephen already cracked this
i was browsing on how to make custom views and yeah stumbled upon this.
there is a random topic view in his code.
https://gist.github.com/ntwb/8167699
Most likely you are either not using or an incorrect table prefix.
Open your SMF Settings.php with a text editor, the file should be in the root folder of your SMF install.
It should have something like this:
########## Database Info ##########
$db_type = 'mysql';
$db_server = 'localhost';
$db_name = 'ntwb_smf';
$db_user = 'mydatabaseusername';
$db_passwd = 'mydatabasepassword';
$ssi_db_user = '';
$ssi_db_passwd = '';
$db_prefix = 'smf_';
$db_persist = 0;
$db_error_send = 1;
Use the database prefix shown there in the import settings screen, in my case it is smf_
Make sure your users are triggering any ‘bad words’ in WordPress comment moderation.
Moderation and BlackListing
If you only want to have a forum on that site install WordPress and bbPress in the domain forums.example.com. If you want to have separate blog and forum you should look at WordPress Multisite using sub domains, your forums would be the 2nd site at forums.example.com and your WordPress blog would be at eaxample.com.
A good starting point is https://codex.wordpress.org/Create_A_Network
I am not sure what you mean, bbPress does not include any links titles details
Could you explain it in more detail please, maybe some screenshots if that will help and/or a link to your forums.
This is neat, thanks for sharing your code @korobochkin
This is a theme issue, you should make a copy of your page.php file and rename it bbpress.php in your themes folder.
Nice, thanks for the follow up and code 🙂
You copy the files to /mytheme/bbpress as stated in the links above.
You also should change your template as I suggested above, that is the primary cause of your issue I think.
Should the admin get an email when a post goes into moderation if I have E-mail me whenever A comment is held for moderation selected in the Settings > Discussion.
I have no idea 😉
bbPress is not currently doing this, nor have I got to the this bit in the recent code updates I have written. This is probably something we would want to iterate on further once the changes we have been making as linked above in #2589 and ‘Per forum moderation’ in #459 and how we handle notifications for not just keymasters but also specific forum moderators also.
are you using a child theme ?? with bbpress.css in your child theme??
cause what i might think is that you have put bbpress.css into your child theme a long time ago
but the bbpress plugin updated their css with a repsonsive layout and you just dont have that code in your child themes bbpress.css
if im right , you can just check out the bbpress plugin and copy styles to your child themes bbpress.css
@tonydes child theme
you put it either one i guess,
i copy most of my code into my custom css editor in my theme because it works automatically for me
but if i have to put the code into my bbpress.css in my child theme , i have to add !important alot
@peterwsterling the Polls plugin generally works well. There is however a “bug”
After creating the poll, if one ever tries to edit the first post in the topic, one will see an error message which says that the poll can only be created for the first post (even if it is the first post).
You’ll lose the shortcode formatting and have to re-create it.
ok, so what happens at the moment is that the bbpress.php calls the footer.php at the bottom of it.
The footer in turn calls the sidebar (this is an annoying habit that theme developers have started doing, sidebars should be called in theme pages not in footers aggghhh!).
so what we’ll do in bbpress.php is simply take out the call to the footer, and put the footer code minus the sidebar into the bbpress.php
so in bbpress.php remove the line which says
<?php get_footer(); // Loads the footer.php template. ?>
Then put this code in it’s place
</div><!– .content-wrap –>
<?php do_atomic( ‘close_main’ ); // oxygen_close_main ?>
</div><!– #main –>
<?php do_atomic( ‘after_main’ ); // oxygen_after_main ?>
<?php do_atomic( ‘before_footer’ ); // oxygen_before_footer ?>
<div id=”footer”>
<?php do_atomic( ‘open_footer’ ); // oxygen_open_footer ?>
<div id=”footer-content” class=”footer-content”>
<?php echo apply_atomic_shortcode( ‘footer_content’, hybrid_get_setting( ‘footer_insert’ ) ); ?>
</div>
<?php get_template_part( ‘menu’, ‘subsidiary’ ); // Loads the menu-subsidiary.php template. ?>
<?php do_atomic( ‘footer’ ); // oxygen_footer ?>
<?php do_atomic( ‘close_footer’ ); // oxygen_close_footer ?>
</div><!– #footer –>
<?php do_atomic( ‘after_footer’ ); // oxygen_after_footer ?>
</div><!– .wrap –>
</div><!– #container –>
<?php do_atomic( ‘close_body’ ); // oxygen_close_body ?>
<?php wp_footer(); // wp_footer ?>
</body>
</html>
Come back with what that does !
Absolutely you can, once in the edit screen of the page, switch to ‘text’ from ‘visual’ (top right of the content box), and paste
echo '<a href="/?random=1">Random Post</a>' ;
in there
could I put that in a page or post, rather than the code?