This would be helpful on my site as well. Anyone know how to accomplish this
Any ideas on this yet people?
Yes, it would be a very useful option to be able to choose the the order of posts.
line 826 in bp-forums-templaetags.php
change ASC to DESC
Wouldn’t recommend at all changing the core, especially the templatetags.
Just write a simple function using the templatetags.php in bp-custom something like:
`function bp_has_forum_topic_posts() {
global $topic_template;
$defaults = array(
‘order’ => ‘DESC’
}`
not tested
Code didn’t work, any plugin for this?
Just wanted to see if somebody could help me out with the code above – I put it in bp-custom.php and it throws this error:
`Fatal error: Cannot redeclare bp_has_forum_topic_posts() (previously declared in /home4/mysite/public_html/classroom/wp-content/plugins/bp-custom.php:60) in /home4/mysite/public_html/classroom/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php on line 1131`
Thanks much
Pass the ‘order’ parameter as DESC.
if ( bp_has_forum_topic_posts( ‘order=DESC’ ) {
The forum topic posts loop can be found in this template:
/bp-default/groups/single/forum/topic.php
I am trying to do exactly this: change the order of the posts displayed for a topic in a forum. I understand that I can do this by setting the ‘order’ parameter to DESC in bp_has_forum_topic_posts. What is eluding me is how to properly over-ride the function on my functions.php (or bp-custom.php) so as to just change the passed arguments.
I’ve tried adding the following to my functions.php file (an it doesn’t work):
function my_bp_has_forum_topic_posts($args) {
$args = 'order=DESC';
return $args;
}
add_filter( 'bp_has_forum_topic_posts','my_bp_has_forum_topic_posts');
Thanks for the help in advance.