your first bit of code should be
function custom_bbp_has_replies($args) {
$args[‘order’] = ‘DESC’; // ‘ASC’ (Ascending, Default), ‘DESC’ (Descending)
return $args;
}
add_filter(‘bbp_before_has_replies_parse_args’, ‘custom_bbp_has_replies’ );
The ($args) brings in all the existing args and then your next line modifies just the ‘order’ arg. Otherwise the only argument passed to the query is the ‘order’ arg, so there is nothing to display.
Hi Robin and thanks for your answer,
I tried with your code, and :
replies are inverted but I cannot see the Topic itself anymore, only answers
– I have this handful of mistakes appearing
f undefined constant ‘custom_bbp_has_replies’ – assumed ‘‘custom_bbp_has_replies’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 620
Notice: Use of undefined constant ‘bbp_before_has_replies_parse_args’ – assumed ‘‘bbp_before_has_replies_parse_args’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 621
Notice: Use of undefined constant ‘custom_bbp_has_replies’ – assumed ‘‘custom_bbp_has_replies’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 621
Notice: Use of undefined constant ‘bbp_show_lead_topic’ – assumed ‘‘bbp_show_lead_topic’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 628
Notice: Use of undefined constant ‘custom_bbp_show_lead_topic’ – assumed ‘‘custom_bbp_show_lead_topic’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 628
I am not a developper, so I do not know what to do with these
hmmm…
1. did you leave in the code, from what you say that is needed as well
function custom_bbp_show_lead_topic( $show_lead ) {
$show_lead[] = ‘true’;
return $show_lead;
}
add_filter(‘bbp_show_lead_topic’, ‘custom_bbp_show_lead_topic’ );
on your other errors, can you post lines from say 615-630 from your functions file
here is all the code I have (line 614 to 626) :
function custom_bbp_has_replies($args) {
$args[‘order’] = ‘DESC’; // ‘ASC’ (Ascending, Default), ‘DESC’ (Descending)
return $args;
}
add_filter(‘bbp_before_has_replies_parse_args’, ‘custom_bbp_has_replies’ );
function custom_bbp_show_lead_topic( $show_lead ) {
$show_lead[] = ‘true’;
return $show_lead;
}
add_filter(‘bbp_show_lead_topic’, ‘custom_bbp_show_lead_topic’ );
The errors :
Notice: Use of undefined constant ‘custom_bbp_has_replies’ – assumed ‘‘custom_bbp_has_replies’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 619
Notice: Use of undefined constant ‘bbp_show_lead_topic’ – assumed ‘‘bbp_show_lead_topic’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 626
Notice: Use of undefined constant ‘custom_bbp_show_lead_topic’ – assumed ‘‘custom_bbp_show_lead_topic’’ in /home/acania/public_html/demo/wp-content/themes/woffice-child-theme/functions.php on line 626
In fact answers are not inverted anymore…
I’m pretty sue that you code is suffering from apostrophe differences.
When you copy code differ3ent editors change the ‘ !
so your code has for instance
(‘bbp_before_has_replies_parse_args’,
suggest you remove the start and end apostrophies and replace eg
('bbp_before_has_replies_parse_args',
Hello Robin,
Well you were right about apostrophes, I changed them all and now I can display the forum withut error messages, but answers arestill not inverted…AND I cannot post links anymore. Well, it seems there is no handy solution for this problem… 🙁
can you post the code you are now using
here it is
function custom_bbp_has_replies($args) {
$args[‘order’] = ‘DESC’; // 'ASC' (Ascending, Default), 'DESC' (Descending)
return $args;
}
add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );
function custom_bbp_show_lead_topic( $show_lead ) {
$show_lead[] = 'true';
return $show_lead;
}
add_filter('bbp_show_lead_topic', 'custom_bbp_show_lead_topic' );
function custom_bbp_has_replies($args) {
$args[‘order’] = ‘DESC’; // 'ASC' (Ascending, Default), 'DESC' (Descending)
return $args;
}
needs the apostrophies sorting on it !!
yes, apostrophes are okay now, with same result as before : links do not appear anymore in new topics. i disable the code, links display…
So strange this function is not in bbpresscore, I suppose many of us need it..
Anyway, thank you so much for your help and patience Robin. I spent much time on this without results. I think I’ll just lokk for another system than bbpress for my forum..