Editing the "Freshness" column contents
-
Can I just say, whilst bbPress is a great SSO solution for those wanting to hook up their WordPress with a forum, it is very difficult to get it going how you like it. There is virtually no decent documentation going over anything except the basics.
I am trying to achieve something relatively simple, however have had to resort to editing the actual plugin itself in an attempt to get it working how I’d like it to be.
What I am trying to do, is edit the freshness part of bbPress. What do I mean by that? Well, I am trying to edit the following:
So what I wanted it to do, was display the actual Topic Title. It makes sense, because as default – what has updated? What thread was last updated without having to drill into the forum?
I also found it bizarre that the title was added within the title tag of the freshness, really? Can we just have some sort of option to allow us to change how things are layed out, or at least create some documentation on how to actually change this without editing the bbPress plugin files (which is what I have had to resort to…)
My question is, how can I change what is displayed there? Surely there’s a better way around it that doesn’t involve hacking my way through the plugin files.
Which bbPress file actually changes this? Like I say, absolutely no documentation on what each file does – it is just guesswork………………
If I am missing something I apologise, but after looking for countless hours I just decided to edit the plugin source to achieve half of what I wanted – still doesn’t help as I would like to change the location of the author picture and time edited and I am not editing the plugin for those.
Am I being stupid?
If anyone would like the most recent topic name within the forum to display on the index, you can edit the Plugin source code directly like so:
if ( !empty( $time_since ) && !empty( $link_url ) ) $anchor = '<a href="' . esc_url( $link_url ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $time_since ) . '</a>'; else $anchor = esc_html__( 'No Topics', 'bbpress' ); return apply_filters( 'bbp_get_forum_freshness_link', $anchor, $forum_id, $time_since, $link_url, $title, $active_id );
Find that chunk of code within bbpress/includes/forums/template.php and change to the following:
if ( !empty( $time_since ) && !empty( $link_url ) ) $anchor = '<a href="' . esc_url( $link_url ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $title ) . '</a>'; else $anchor = esc_html__( 'No Topics', 'bbpress' ); return apply_filters( 'bbp_get_forum_freshness_link', $anchor, $forum_id, $time_since, $link_url, $title, $active_id );
All we have done here is changed the $time_since to $title. Now you need to re-add the $time_since variable in there somewhere, which is a pain because you may not want it right after the thread title (like myself…)
- You must be logged in to reply to this topic.