It is best not to make changes to the bbPress core files because they will be lost when you update. The same for your theme files unless it’s already a custom theme. The best way is with a Child Theme.
In your theme folder (or preferably, child theme), create a subfolder called css with a file called bbpress.css so you have /wp-content/themes/%your-theme%/css/bbpress.css
The last rule defined overrides any previous, conflicting rules so this file will make your styles the last rules. See if it works then and if it still doesn’t then check for what is overwriting it – because something is.
(Specificity is usually the reason why your CSS doesn’t work the way you think it should. If there are styles in your code that are more specific, they will win. There is a good article on specificity at Smashing Mag.)
You are right niuserre, let me apologize,
As far as I am aware, we are not using shortcodes (we have not created any page for showing the forums but using directly the templates and urls filled on the settings).
I am working with a tweenty twelve child theme. My wordpreses version 3.6.1. My bbpress: Version 2.4 localized to spanish.
The exact issue is that whenever I try to edit a written post, raw html appears in the text area for editing. The html that appears is not only the one corresponding to the content of the reply i would like to edit.
It comprises also the breadcrums and much more tags and content of the page. Exactly inside the editor appears all the content inside the <div class=”entry-content”> tag (this element is the parent of<div id=”bbpress-forums”>).
I do not what that can be related with…
Thank you for your time,
For those saying they have the same thing, please can you be more specific to help identify the problem?
So versions and theme being used plus the steps you take to produce the error (imagine you’re talking someone on the phone through how to get the same problem you did so they can see it too, imagine they’re not good at this stuff so you have to be really obvious about everything).
Also, are you using bbpress shortcodes in a page to display your forums or not?
You absolute STAR!!!! Just using bbp_get_user_id( 0, true, false ) worked perfectly as in echo '<a href="'.$link.'?pmaction=newmessage&to='.bbp_get_user_id( 0, true, false ).'">
Thanks x 1000
It is caused by a CSS problem.
.reply a {
display: inline-block;
position: absolute;
right: 0;
bottom: -2px;
height: 20px;
padding: 6px 10px 2px;
font-family: 'BebasNeueRegular',sans-serif;
font-size: 14px;
font-size: .875rem;
font-style: normal;
border-bottom: 2px solid rgba(0,0,0,0.1);
}
When I turn off position: absolute; the name appears.
Another guess… bbp_get_user_id( 0, true, false )
Which translates as:
bbp_get_user_id ([int $user_id = 0], [bool $displayed_user_fallback = true], [bool $current_user_fallback = false])
This is a complete guess based on the way it’s done for a reply which is this:
<a href="'.$link.'?pmaction=newmessage&to='.get_the_author_meta("ID").'"><span class="pm">Send for author a PM</span></a>
So I’m thinking get_user_meta("ID") maybe?
Hi,
Anyone know how to call the profile from the bbpress user profile to a custom page template? Tried a few pieces of code and searched this site but having no luck! Would appreciate any advice…
Hi,
I’m trying to integrate the Cartpauj PM plugin with my new install of bbPress.
I want to add a private message link to member’s profile page, so when they click the link it pre-poluates the ‘To’ field in the message.
I’m using…
<?php if($page = get_page_by_title('title of the page for messages'))
{
$link = get_permalink($page->ID);
echo '<a href="'.$link.'?pmaction=newmessage&to='xx'">
<span class="pm">Message
</a></span></a>';
} ?>
But I’m stuck at what ‘xx’ should be.
If I use .$user_ID.
echo '<a href="'.$link.'?pmaction=newmessage&to='.$user_ID.'">
It pre-popluates my user name correctly. Anyone help with what I need to use to pull in the ID of the profile the message link is attached to? I’ve tried '.bbp_displayed_user_field( 'ID' ).' – that pulls the correct ID number but places it outside of the clickable link
Anyone steer me in the right direction?
Thanks in advance
Yeah anyone with an update for the code? It’s not working on my theme either.
You have <?php bbp_forum_permalink(); ?> in your code, which I guess should be <?php bbp_last_topic_permalink(); ?> if you want to link to the topic.
Yes, you are correct, unfortunately there’s no easy way to do get hidden at the moment. However, I’ve just tried manually reverting the changes from 2.4 that are causing the problem and it looks like that works.
All I’ve done is revert the 3 changes here: https://bbpress.trac.wordpress.org/changeset/5060/trunk/includes/forums/functions.php
I’ve done it fast and dirty by editing core and replacing the new lines with the old ones which you really shouldn’t do if you can avoid it as it will be overwritten next update….but hopefully next udpate will fix the problem anyway. I can’t see it causing problems anywhere else and that code was only changed for best practice I think so should be OK.
I’ve done it using a filter in my functions.php but I’d be interested to know why the above method doesn’t work if anyone can explain please.
My code in case anyone needs it:
function add_clearfix( $classes ) {
$classes[] = 'clearfix';
return $classes;
}
add_filter( 'bbp_get_forum_class', 'add_clearfix' );
bbPress 2.4
WP 3.6.1
running on localhost
I need to add a class to bb_forum_class and since 2.1 I thought that this should work:
<?php bbp_forum_class('clearfix'); ?>
But it’s not adding the class, can anyone tell me what I’m doing wrong please?
I think the relevant bit of core for this is:
function bbp_get_forum_class( $forum_id = 0, $classes = array() ) {
$bbp = bbpress();
$forum_id = bbp_get_forum_id( $forum_id );
$count = isset( $bbp->forum_query->current_post ) ? $bbp->forum_query->current_post : 1;
$classes = (array) $classes;
// Get some classes
$classes[] = 'loop-item-' . $count;
$classes[] = ( (int) $count % 2 ) ? 'even' : 'odd';
$classes[] = bbp_is_forum_category( $forum_id ) ? 'status-category' : '';
$classes[] = bbp_get_forum_subforum_count( $forum_id ) ? 'bbp-has-subforums' : '';
$classes[] = bbp_get_forum_parent_id( $forum_id ) ? 'bbp-parent-forum-' . bbp_get_forum_parent_id( $forum_id ) : '';
$classes[] = 'bbp-forum-status-' . bbp_get_forum_status( $forum_id );
$classes[] = 'bbp-forum-visibility-' . bbp_get_forum_visibility( $forum_id );
// Ditch the empties
$classes = array_filter( $classes );
$classes = get_post_class( $classes, $forum_id );
// Filter the results
$classes = apply_filters( 'bbp_get_forum_class', $classes, $forum_id );
$retval = 'class="' . implode( ' ', $classes ) . '"';
return $retval;
}
As you said, expert can make the “shortcode” to override the password….
do you know the trick!
There is not an easy way to do this, as far as I know.
You could create a private WordPress page/post that is password protected and use a bbpress shortcode to display the forum on that page but anyone who has the direct link to that forum could skip the password.
Hey, I modified it a little to fit the needs of my forum…
I can’t show you the link as I’m working on localhost at the moment, but here is what I did.
Inside loop-single-forum.php, I removed this:
<?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?>
<?php bbp_forum_freshness_link(); ?>
<?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>
And placed this in it’s place:
<a class="bbp-forum-freshness" href="<?php bbp_forum_permalink(); ?>">
<?php bbp_forum_last_topic_title(); ?></a>
(<?php bbp_forum_last_active_time(); ?>) by <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>
Now the last step I need help with is…
Right now if a forum doesn’t have posts in it yet, it shows the time I created the forum. Which is very weird. So what I i need is a php if/else code that would check if there is a forum_last_topic if there is, it must show my code… if there isn’t, it must show the text “No topics yet”. How do I do this? I have very basic php knowledge
In strange, because i use this with no problems, are you sure u have add the code after freshenss in forum loop?? I have opened a new thread here because this metod of Freshness in forum do not work fine, it id discordant from topic Freshness..
Please write here a link of your forum…
Awesome! Thank you… One more question though.
After using your code, if there has been no posts made in a forum, it shows a random time (which seems to be the time I created the forum) and the topic title appears blank. How can I do this:
if the forum has posts, show the latest post title and time (the code you gave me), otherwise show “No topics posted yet”.
Hi, this is my solution:
<div class="bbp-forum-last-topic-name"><a href="<?php bbp_forum_last_topic_permalink(); ?>" title="<?php bbp_forum_last_topic_title(); ?>"><?php bbp_forum_last_topic_title(); ?></a></div>
Create a class in your bbpress css named bbp-forum-last-topic-name and give your personal style…
Put all code into <li class="bbp-forum-freshness"> </li>
Hello, I am new to wordpress. I’ve ran into issues as I’ve been building a site most have been fixed after 4-20min of searching and troubleshooting. But I have been searching for this one for about 3 hours by now and I have no clue what the issue is.
Basically registration to my site/forum doesn’t work. I put the right short codes for registration and password recovery. Once I click register it takes me to the page. I put in a user name, email, and click ”register”. Then I get taken to the sites WordPress login. No email sent, nothing. My site is koolhow.com. If anyone can help me out I would greatly appreciate it. It’s been driving me insane. :\
They are all in wp_posts just like topic & reply, forum is the post_type in wp_posts
Modify your query that you linked in your original post:
$query=”SELECT * FROM wp_posts WHERE post_type = 'forum' OR post_type = 'topic' OR post_type = 'reply' ORDER BY post_date DESC”;
As per https://bbpress.trac.wordpress.org/ticket/2298
Works for me. Likely related to incorrect database encoding. Are you/they able to use these characters in regular WordPress posts and/or pages?
So if you change the URL’s back to post name do these pages work correctly?
eg. http://ccnb.co.kr/?page_id=27 becomes http://ccnb.co.kr/오시는길
Just set your forums to ‘private’
https://codex.bbpress.org/getting-started-with-bbpress/#creating-your-first-forum
Visibility: decide whether your forum is public, private or hidden.
Public – Anyone can see these forums
Private – Only logged in registered users can see these forums
Hidden: Only Moderators/Admins can see these forums