not sure what you mean, but corrected code here
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ;
function rew_filter_anonymous_post_data( $retval, $r ) {
// Filter variables and add errors if necessary
$r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] );
if ( empty( $r['bbp_anonymous_name'] ) )
bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) );
// Website is optional
$r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] );
// Return false if we have any errors
$retval = bbp_has_errors() ? false : $r;
// Finally, return sanitized data or false
return apply_filters( 'rew_filter_anonymous_post_data', $retval, $r );
}
no insert code on fuctions file. on site error
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ;
function rew_filter_anonymous_post_data( $retval, $r ) {
// Filter variables and add errors if necessary
$r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] );
if ( empty( $r['bbp_anonymous_name'] ) )
bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) );
// Website is optional
$r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] );
// Return false if we have any errors
$retval = bbp_has_errors() ? false : $r;
// Finally, return sanitized data or false
return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $r );
}
untested, but try adding this to your functions file
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ;
function rew_filter_anonymous_post_data( $retval, $r ) {
// Filter variables and add errors if necessary
$r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] );
if ( empty( $r['bbp_anonymous_name'] ) )
bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) );
// Website is optional
$r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] );
// Return false if we have any errors
$retval = bbp_has_errors() ? false : $r;
// Finally, return sanitized data or false
return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $r );
}
This is in a file called form-anonymous.php :
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpress
where %your-theme-name% is the name of your theme
find
wp-content/plugins/bbpress/templates/default/bbpress/form-anonymous.php
Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/form-anonymous.php
bbPress will now use this template instead of the original
and you can amend this
you will see that lines 26-29 contain
<p>
<label for="bbp_anonymous_email"><?php _e( 'Mail (will not be published) (required):', 'bbpress' ); ?></label><br />
<input type="text" id="bbp_anonymous_email" value="<?php bbp_author_email(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_email" />
</p>
Just delete this and save, and this field will not be shown
Hi,
Just a question: how can I know which page model is being used by the forum pages ?
Is there a way to know it through the dashboard or inspecting the source code ?
Regards
Philippe
bbp additional shortcodes plugin solved the problem 🙂
Hi,
I’m using [bbp-single-forum id=#] shortcode to show forum under a certain category. Above it, there is a status bar (counts topics and replies). It is not fitting with my homepage. Is there a way to delete it?
Screenshot:https://www.dropbox.com/s/52kip18610x7iu7/forum-1.png?dl=0
i had to do this today for a few hours, only hidden with CSS and message displayed but might help someone:
// put forum in read only mode
add_action('bbp_theme_after_reply_form','gd_bbp_read_only_mode');
add_action('bbp_theme_after_topic_form','gd_bbp_read_only_mode');
function gd_bbp_read_only_mode(){
?>
<style>
fieldset.bbp-form{ display: none;}
</style>
<div style="background: red;color: white;"><h2>The forum is currently in read only mode while we perform some maintenance, this should only take a few hours.</h2></div>
<?php
}
Hi
I’ve been reading many posts on this forum and tried out many proposed solutions but to no avail up to now 🙁
I first started with the copy of an unmodified and renamed in “bbpress.php” “page.php” file at the root of my theme folder, then with another one with a slight modification of the code substituting the class “content-area”with “content-area-wide”, I then tried another method creating a subfolder in my theme and copying the above mentioned file as well as a modified “style.css” file.
The code was simply :
.content-area-wide {
float: left; margin-right: -100%; width: 100%}
@import url (“../twentyseventeen/style.css”);
Unless the code is not correct or the path or it’s syntax either, of course it didn’t work either.
Surprisingly, the page listing all the forums is using almost the full width, and looks exactly what I’m looking for anyway but as son as I get in one of the forums they are displayed as if on one column way and aligned on the left.
Same thing for the abovementioned page if I go back to it unless I refresh it…
I should point out that I don’t use or have any sidebar for these pages and I’m not concerned by this kind of problem like many other people!
As I’m not a master of the code, could anybody help me and describe each step to solve this frustrating issue so that I can follow each step and not guess intermediate steps considered as obvious are easy by the most learned guys !?
Thanks so much for our site subscribers
Regards,
Philippe
OK, I found the code who make this issue.
function SearchFilter($query) {
if ( $query->is_search && !is_woocommerce() && !is_admin()) {
$query->set( 'post_type', 'post,page' );
}
if ( function_exists( 'is_woocommerce' ) ) :
if ( $query->is_search && is_woocommerce() && !is_admin()) {
$query->set( 'post_type', 'product' );
}
endif;
return $query;
}
add_filter('pre_get_posts','SearchFilter');
I put this function in functions.php because without that I can’t search on my blog AND Woocommerce with the plugin Releanssi).
But what the problem with this function?
EDIT: I found a topic and the fix of @robin-w
Topics not appearing in forum
I will try this fix very soon.
I am using WordPress 4.7.2 and bbpress Version 2.5.12. I have tried the code as mentioned in previous post. However, it doesn’t work. Could any generous guys can help me?
My main objective is to set spectator to have ability to post/edit a post. That’s it.
1. Is there any other easiest way to do it?
2. If no, any change besides the false/true value I suppose to amend?
3. Where should I put the code, only capabilites.php?
I wish someone can show me step by step solution. Thank you so much.
Thanks for your reply.
This might seem obvious for the creator of bbpress. But it really isn’t. I think you need to drop the word “partner” cause that is really confusing.
Method 1:
This doesn’t do anything other than adds a page that you can add to your navigation. You could instead basically add a custom link to your navigation because the page itself isn’t displayed since you have the same slug as you set for forum root index. The default bbpress index will be displayed. Having a wordpress-page is just confusing since nothing added to that page is displayed.
Method 2:
This method doesn’t mention the slug at all so I presume the slug here is different then the one set as forum root index. Fine. Name your page anything and add anything along with the shortcode [bbp-forum-index]. There you have it. You think…
You think you have customized your forum index page. But in fact that page is just a non-bbpress page that happens to have bbpress content in it. How so?
1) Your breadcrumb forum index link will still display the default index page.
2) And if you use the bbp style pack to add login-logout-buttons to your navigation it won’t recognize your custom index page as a bbpress-page. (The buttons won’t display when option is set to only display on forum pages)
Maybe it’s just me, but If I create my own index page, of course I want that page to be the index page linked to in the breadcrumbs as well.
So. I’m struggling with the word “partner” here. In my mind it says a wordpress page can partner with bbpress and act as the forum index page. As a replacement not as an addition. It can’t be that you should have TWO different index pages, can it?
So, how do I create a custom forum index page that is recognized as a forum page and acts as the forum index page in the breadcrumbs?
Cheers!
Hello, using WP 4.7.2, with BBPress sort topic relpies 1.0.3, I’ve set the form sort options to descending, along with forums and topics sidebar to descending. when I view Forums or Topics from their main pages the plug in works as advertised, however when I use the short code [bbp-single-topic id=1286] what is displayed is the topic but not sorted correctly.
REEF Webcam
should have newst post on top.
see
Step by step guide to setting up a bbPress forum – Part 1
item 3
method 2 lets you add text before (or after) such as
“welcome to our forums….”
I was using method 1 with postname. My forum root is called “forums” in settings. When that didn’t work, I tried #2 by putting a shortcode in. Still didn’t work.
I noticed last night that the individual forums show fine when I go directly to them:
http://livelovecards.com/forums/forum/cardstock/
It’s not pretty, but at least it’s formatting.
So I guess it’s just the list of forums that isn’t showing correctly. Is there something different about this page?
Thanks for your help, Robin. I appreciate it more than you know. 🙂
Darlene
Customize your Forums root. Partner with a WordPress Page and use Shortcodes for more flexibility.
What does this mean??
I’ve set the forums root to “forums”. Then I’ve created a WP-page with slug “forums” and included some shortcodes.
The WP-page is ignored, so content displayed on /forums is the bbpress default index page.
What does this mean: “Partner with a WordPress Page and use Shortcodes for more flexibility.”??
How do I replace the default index with a WP-page?
I suspect it is a theme issue, it seems to be rendering as a paragraph.
what method in item 3 below are you using
Step by step guide to setting up a bbPress forum – Part 1
Old topic to be chiming in on but this helped a lot, thanks @tharsheblows!
I changed it up to simply add buttons to the pages instead of the login form, and made sure that upon login, it redirected back to the topic or forum.
//this adds the login and register links underneath on a single topic so someone can leave a reply. It uses the same logic as form-reply
function mjj_new_reply_login(){
if( !bbp_current_user_can_access_create_reply_form() && !bbp_is_topic_closed() && !bbp_is_forum_closed( bbp_get_topic_forum_id() ) ){ ?>
<a href="<?php echo wp_login_url( get_permalink() ); ?>" title="Login">Login</a>
<a href="<?php echo wp_registration_url(); ?>">Register</a>
<?php
}
}
add_action('bbp_template_after_single_topic', 'mjj_new_reply_login');
//this adds the llogin and register links underneath on a single forum so someone can start a topic. It uses the same logic as form-topic
function mjj_new_topic_login(){
if( !bbp_current_user_can_access_create_topic_form() && !bbp_is_forum_closed() ){ ?>
<a href="<?php echo wp_login_url( get_permalink() ); ?>" title="Login">Login</a>
<a href="<?php echo wp_registration_url(); ?>">Register</a>
<?php
}
}
add_action('bbp_template_after_single_forum', 'mjj_new_topic_login');
I personally did them as buttons, if you have a .button class just add class="button" between <a and href=.
Hope that helps someone in the future.
I am using WordPress 4.7.2 and bbpress Version 2.5.12. I have tried the code as mentioned in previous post. However, it doesn’t work. Could any generous guys can help me?
My main objective is to set spectator to have ability to post/edit a post. That’s it.
1. Is there any other easiest way to do it?
2. If no, any change besides the false/true value I suppose to amend?
3. Where should I put the code, only capabilites.php?
I wish someone can show me step by step solution. Thank you so much.
Hi,
we needed to use the visual editor for our forum, since a lot of the normal users are not familiar with html, especially when it comes to URLs/Links
Sadly, there are a lot of copy&paste related texts that are showing visible code.
Mostly METADATA from word, when someone copied text from a doc or docx file.
Now, the strange thing is, that I couldn´t reproduce this with my version (Office 2016, Win 8).
The visual editor looks fine (the text editor is full of meta data, a mess, but it “looks OK”)
Has anyone an idea why this happens to some users and some not?
I found a plugin for this kind of problem, but maybe there are recommendations, experiences or other solutions. Thank you in advance!
I had a similar need – to show the user’s bio on their replies – so sharing my solution here, a simple function created after having a look at this nifty little plugin by Robin W.
function show_bio_bbp_replies () {
$user_id = bbp_get_reply_author_id( $reply_id );
$usermeta = get_userdata( $user_id, 'description' );
echo '<p class="bbp-reply-user-bio">'.$usermeta->description.'</p>';
}
add_action ('bbp_theme_after_reply_author_details', 'show_bio_bbp_replies');
you may need to add this to your functions file to get it for particpants
add_filter (‘pw_bbp_parse_shortcodes_cap’ , ‘publish_topics’ ) ;
This used to work, see no reason why it should not still be fully functional!
https://wordpress.org/plugins/bbpress-do-short-codes/