Skip to:
Content
Pages
Categories
Search
Top
Bottom

Help with functions.php mod for bbPress


  • K-Path
    Participant

    @auriel

    I was told that I could either make the breadcrumbs go away completely or modify them. I chose to modify the appearance of the “crumbs of bread”. The following code was offered to me as a possible solution to my desire to modify my breadcrumbs . . .

    Layout and functionality – Examples you can use

    function mycustom_breadcrumb_options() {
        // Home - default = true
        $args['include_home']    = false;
        // Forum root - default = true
        $args['include_root']    = false;
        // Current - default = true
        $args['include_current'] = true;
     
        return $args;
    }
     
    add_filter('bbp_before_get_breadcrumb_parse_args', 'mycustom_breadcrumb_options'

    When inserted at the end of TwentyTen Theme’s functions.php’s code as was instructed in this document . . .

    Functions files and child themes – explained !

    The result was this message in black against a white screen . . .
    Parse error: syntax error, unexpected end of file in /home/sylviannai/public_html/journal/wp-content/themes/twentyten/functions.php on line 568

    Is found at the root of my forums . . .
    http://hcrd.foundation/journal/forums/

    So what I’m asking is there additional code or an error in the code as that last line suggests.

    Thank you for reading and please, please help. I’m losing my mind on this project and I didn’t have that many marbles to play with before I started in the first place.

    Auriel

Viewing 1 replies (of 1 total)

  • Robin W
    Moderator

    @robin-w

    Ok, thanks and yes we can fix that.

    1. the code is missing ‘);’ by mistake, it should read

    function mycustom_breadcrumb_options() {
        // Home - default = true
        $args['include_home']    = false;
        // Forum root - default = true
        $args['include_root']    = false;
        // Current - default = true
        $args['include_current'] = true;
     
        return $args;
    }
     
    add_filter('bbp_before_get_breadcrumb_parse_args', 'mycustom_breadcrumb_options');
    

    The extra ‘);’ is right at the end

    I’ve fixed the documentation

    2. as stated in https://codex.bbpress.org/functions-files-and-child-themes-explained/

    you should not be adding code to the end of a main theme’s functions, but should be creating child theme. By all means leave it there and test that it works, but then create a child theme and move it there or you risk losing the change on an update. I’ll try and make this even clearer in the documentation – it is a first version !

    Hope that helps you, and please come back with any further issues ! 🙂

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