find
wp-content/plugins/bbpress/templates/default/bbpress/content-single-topic-lead.php
transfer this to your pc and edit
that will let you remove the header and footer, and change the date function
and save
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
Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/content-single-topic-lead.php
bbPress will now use this template instead of the original
Yes, found it. I have deleted the header & footer part in the php file and put in my child theme.
Does the date function look like this below?
<span class="bbp-topic-post-date"><?php bbp_topic_post_date(); ?></span>
May I know what is the freshness function so that I can replace it with?
Other than lead topic, how about other replies? I want them to display freshness as well.
Regards with thanks!
you can leave the template for time unchanged.
add_filter ('bbp_get_topic_post_date' , 'rew_change_to_freshness', 10 , 6) ;
add_filter ('bbp_get_reply_post_date' , 'rew_change_to_freshness', 10 , 6) ;
function rew_change_to_freshness ($result, $topic_id, $humanize, $gmt, $date, $time) {
$result = bbp_get_time_since( bbp_convert_date( $time ) ) ;
return $result ;
}
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
Thanks Robin! All topics & replies can already display freshness.
One more thing about lead topic. I’d like to add a label like “Thread Starter” on top of the avatar of the topic starter for every reply (EXCEPT the lead topic) from the topic starter. In this case we will always keep track on who is the topic starter as the conversation goes on.
It is similar to the screenshot below (from other WordPress forum):
https://paste.pics/MRVM6
Regards.
bbp style pack
once activated go to
dashboard>settings>bbp style pack>forum roles and you can set the topic author
Hi, how if I wish to place the label on top of avatar so that it is easily identifiable? There is no such option in the bbp style pack.
in that tab there is the option ‘Where to show roles’ – it is the first item in that tab.
Oh… yes. It’s done. Thanks man!
I actually tried to change font of the label “Thread Starter” (under Topic Author) using Style Pack, but it seems not working at all. Any solution?
thanks – I’ll take a look at that
thanks, I found the issue – fixed in 5.4.3 just released.
Recently I found that all freshness display all showing “sometime ago”.
I came across a topic related to same issue Notifications – Date Received = “Sometime Ago”. It seems that the problem is related to time zone that makes this freshness display totally unworkable. If I don’t want to change to the actual display of date/time, any solution for this?
Regards.
@enkoes – is this related to just lead topic, or does this need posting as a new topic?
After checked, this is related to all replies, not just the lead topic affected.
Within same topic, some replies that created few days ago shows “4 hours, 12 minutes ago” today. Other replies may show “sometime ago”. The freshness display seems like all mess up.
eg,
first post (lead topic): 10 hours, 51 minutes ago
2nd reply: 2 hours, 36 minutes ago
3rd reply: 15 hours, 52 minutes ago
4th reply: 7 hours, 21 minutes ago
5th reply: 16 hours, 27 minutes ago
so is this with this function installed?
add_filter ('bbp_get_topic_post_date' , 'rew_change_to_freshness', 10 , 6) ;
add_filter ('bbp_get_reply_post_date' , 'rew_change_to_freshness', 10 , 6) ;
function rew_change_to_freshness ($result, $topic_id, $humanize, $gmt, $date, $time) {
$result = bbp_get_time_since( bbp_convert_date( $time ) ) ;
return $result ;
}