Skip to:
Content
Pages
Categories
Search
Top
Bottom

Links in new topic


  • Oaz
    Participant

    @oaz

    Hello there,

    I have a problem with pasting links in new topics : they do not display. (They do display normall in replies though)

    This is due to trying to inverse order of replies : I used bbpress toolkit for that purpose and the problem happened.
    I also tried inverting replies order with this snippet in functions.php file :

    function custom_bbp_has_replies() {
    $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 snippet works as far as replies rder is concerned, but then I bump in the same problem, links not displaying in new topics.

    Any clue how to invert replies order without this link issue ?

    thanks

Viewing 11 replies - 1 through 11 (of 11 total)

  • Robin W
    Moderator

    @robin-w

    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.


    Oaz
    Participant

    @oaz

    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


    Robin W
    Moderator

    @robin-w

    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


    Oaz
    Participant

    @oaz

    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…


    Robin W
    Moderator

    @robin-w

    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',


    Oaz
    Participant

    @oaz

    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… 🙁


    Robin W
    Moderator

    @robin-w

    can you post the code you are now using


    Oaz
    Participant

    @oaz

    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' );

    Robin W
    Moderator

    @robin-w

    function custom_bbp_has_replies($args) {
     $args[‘order’] = ‘DESC’; // 'ASC' (Ascending, Default), 'DESC' (Descending)
    
    return $args;
     }

    needs the apostrophies sorting on it !!


    Oaz
    Participant

    @oaz

    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..


    Robin W
    Moderator

    @robin-w

    ok

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
Skip to toolbar