Thanks for the reply… temporarily I solved it by duplicating bbp_has_replies function in my function.php and changing [‘post_parent’] argument to ‘post_parent’ => bbp_get_topic_id()
…
It does the job now.. but I am not happy with this because I am unnecessarily duplicating the good function.. I think my add_filter is not working as I intended.. but don’t know what’s wrong with it.. Would you guys please help me?
in function.php , I have function looks like
function my_bbp_has_replies($arg = ”)
{
$args = array();
$topic_id = bbp_get_topic_id();
$args['post_parent'] = $topic_id;
return $arg;
} // function
and after I call bbp_has_replies() , I had put add_filter(‘bbp_has_replies’, ‘my_bbp_has_replies’); in loop-single-topic.php ..
I have looked into loop-replies.php and loop-single-reply.php .. as Lynq suggested (btw, thank you) … but there was no function or filter trying to filter the bbp_has_replies..
Thank you guys..
Hey guys,
I know this has been asked quite a few times as I have come across a few posts. The problem I have is this:
I am using the Fancy Editor on the front end to edit bbPress replies and topics.
If as a forum user I edit my post using the visual tab then nofollow is applied to the link as required. If as a forum admin I edit my post using visual or html tab then nofollow is applied aswell.
The issue comes when I go to save my post as a forum user using the html tab and type out my link tag. This will not apply a nofollow to the reply/topic.
I have this inside a custom plugin already:
add_filter('post_author_link', 'bb_rel_nofollow');
add_filter('post_text', 'bb_rel_nofollow');
Thanks for any help.
-
This topic was modified 13 years, 7 months ago by
Lynq.
bbPress 2.1 now has built-in theme support, try using the steps outlined here:
https://codex.bbpress.org/theme-compatibility/
Sorry for the long time it took me to respond.
This is my problem:
my bbpress uses permalinks and prettylinks which makes all the user links use the user name instead of ID.
for example:
http://www.mysite.com/forum/users/Roni%20Cohen
this leads to 404.
instead of
http://www.mysite.com/forum/users/524 (the user id)
this leads to the user page.
What should I change in my wordpress / bbpress in order to support those kind of links.
I already set mod_rewrite but i guess some rules are missing or that i’m using something in the wrong way.
I found the part in the code that handles this but I don’t want to change that to use id hard coded.
Am i clear now?
It would be quite nice to have some of the most commonly asked forum questions somewhere and then a couple of useful topics users can check out.
I know that customizing bbp_list_forums is a popular one.
Ok, this is definitely NOT the most elegant solution, but I contrived a crude fix to the problem. Since the false 404 flagging was happening only on user profile pages, I added the following to my single_user.php template just before the header.
global $wp_query;
$wp_query -> is_404 = false;
get_header(); // Loads the header.php template. ?>
Basically I’m just forcing the profile page to not be 404. I may try to work out a better solution, but for the time being, this appears to work.
EDIT: looks like the code snippet is having trouble displaying a greater than sign, anywhere you see > above, it should be a greater than sign (>).
-
This reply was modified 13 years, 7 months ago by
aaclayton.
-
This reply was modified 13 years, 7 months ago by
aaclayton.
Sounds good… would love to put the emphasis on the end-use of the forums in some way too. A lot of our users come to us with their intended solution (goal of using bbPress) already in mind. Might be helpful to focus one section on that as well, so folks could work backwards.
How do you want to put up the skeleton of these docs?
Hello guys!
I am trying to run a replies loop within topics loop… and scratching my head..
(more specifically, at loop-single-topic.php compat template .. I am trying to do something like..
bbp_has_replies();
while ( bbp_replies() ) : bbp_the_reply();
$current_topic_reply_id = bbp_get_reply_id();
echo $current_topic_reply_id ;
endwhile;
and.. i am getting.. same IDs under every topic..
would you help me to get reply IDs for each topic including the topic ID itself?
Thank you very much guys..
If you use the forum base ‘X’ and forum slug ‘y’ and have ‘Forum Prefix’ checked
– hxxp://www.example.com/x/y/yournotstupid
– (default bbPress slugs hxxp://www.example.com/forums/forum/yournotstupid/ )
If you use the forum base ‘X’ and forum slug ‘y’ and have ‘Forum Prefix’ UNchecked
– hxxp://www.example.com/y/docscouldbebetter
– (default bbPress slugs hxxp://www.example.com//forum/docscouldbebetter/ )
There is some basic doc’s here https://codex.bbpress.org/getting-started-with-bbpress/#creating-your-first-forum and https://codex.bbpress.org/forums-settings/#archive-slugs
-
This reply was modified 13 years, 8 months ago by
Stephen Edgar.
-
This reply was modified 13 years, 8 months ago by
Stephen Edgar. Reason: formatting
Duplicate, please only post your question once.
bbPress Login Shortcode NOT for use on sidebar?
Duplicate, please only post your question once.
bbPress Login Shortcode NOT for use on sidebar?
I see we can add the bbPress Login widget to the sidebar. I don’t use sidebars; is there any shortcode for coding it in elsewhere, in our pages, other than the sidebar?
I see we can add the bbPress Login widget to the sidebar. I don’t use sidebars; is there any shortcode for coding it in elsewhere, in our pages, other than the sidebar?
I see we can add the widget to a sidebar. Is there any shortcode for coding it in elsewhere, in our pages, other than the sidebar?
So I think it is a permalink issue but I am not sure. I am developing a theme framework and I want to integrate bbpress with it and thus i was testing bbpres default installation. How ever going to site/forums/forum/test gives me a 404 error. even site/forums gives me a 404 – the theme throws the 404 –
Can any one give me any ideas as to how to fix this? My permal link structure is
/%category%/%postname%/
HELP!
I’m having issues with my BBpress WordPress installation as of late (since I did a plugin update to 2.1.1) on all pages I get the error:
Warning: get_class() called without object from outside a class in /nfs/c05/h01/mnt/77944/domains/charterproject.ca/html/wp-content/themes/charterprojectbb/functions.php on line 529
I tracked this in the functions file in my theme that controls the WP theme and the BBPress theme.
the code is:
if ( 'bbPress' == get_class( $bbp ) ) {
$bbp->theme_compat->theme = new BBP_Twenty_Ten();
}
endif;
I’m not a wiz at PHP so I’m not sure why this causing this error but it does result in the form being quite non-functioning, please help! you can view the site for reference at : http://charterproject.ca
Pez
Sorry, I guess I’m not being very clear. The is_bbpress() function already seems to deliver the conditional logic I need. That (I don’t think) isn’t my problem. My problem is getting the proper syntax for removing the actions that add styles and scripts to the head area.
remove_action ( 'bbp_enqueue_scripts' , 'enqueue_styles' );
remove_action ( 'bbp_enqueue_scripts' , 'enqueue_scripts' );
This doesn’t work, nor do some variants that I have tried. Could you suggest the proper syntax for removing the relevant actions, regardless of the conditioning logic employed?
Now I finally got it to work. You just copy the bbpress.css file to /my-child-theme/css/ and voilá, it works. When I found out that I looked in bbpress-functions.php and stumbled over this line:
// Check child theme
if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $file ) )
Which states the obvious, it looks for bbpress.css in the /css/ folder in your child theme. If found, it will replace it with the default css.
If any admin reads this, can you please elaborate a bit more on the subject. It is very diffuse how all this works.
-
This reply was modified 13 years, 8 months ago by
DramaticBaby.
Hi, I’m trying to create a custom theme for the bbPress forum. I already got a child theme based on Twenty Eleven, and I’m trying to style bbPress with my style.css in the child theme folder.
The problem is that bbpress.css is imported in the html code after my style.css, overwriting the latter’s styling. How do I force bbPress to use style.css instead, even though bbpress.css is imported after?
I have been struggling with this for hours and hours.
-
This topic was modified 13 years, 8 months ago by
DramaticBaby.
Not sure I understand the problem. Spaces aren’t valid in URLs unless they are encoded.
Expanding my search to include all of WordPress resulted in this fine code I just plop in to my functions.php that’ll remove it:
function the_title_trim($title) {
// Might aswell make use of this function to escape attributes
$title = attribute_escape($title);
// What to find in the title
$findthese = array(
'#Protected:#', // # is just the delimeter
'#Private:#',
'#Privat:#'
);
// What to replace it with
$replacewith = array(
'a', // What to replace protected with
'b' // What to replace private with
);
// Items replace by array key
$title = preg_replace($findthese, $replacewith, $title);
return $title;
}
add_filter(‘the_title’, ‘the_title_trim’);
Credit: https://wordpress.org/support/topic/how-to-remove-private-from-private-pages?replies=24
I figured out how to hook into it. I created bp-custom.php in the plugin directory and modified the action like this:
add_action( 'bbp_theme_after_reply_author_details', 'display_authorlevel' );
function display_authorlevel() {
// code goes here that you want to executed under the avatar. I wanted to display my WP roles instead of the bbPress roles, so I wrote a custom function to pull the WP roles and put it here.
}
Thanks so much for looking!
It’s a WordPress core issue, and one I’m not sure we can easily filter out. I’ll take another look at this for 2.2, but I think it’s hard-coded in.
Yay, I found the file! I downloaded my entire website, then used the program MultiFindPro to search for Hello World within my website files. It found it right away and I was able to remove the echo statement.
Thanks so much for help, John. 🙂 I really felt like I was losing my mind there, haha.
(Note to self: don’t code late at night while sleepy.)