Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add Text To/Before Breadcrumbs

  • @lissyhunnybee

    Participant

    Hello everyone, I am new to bbpress and slowly working my way around lol

    I’ve modified template.php to add the text “You are here:” to the breadcrumbs to match the breadcrumbs for the rest of my site, but I’d prefer to use a function to make these changes instead. The problem is I cannot wrap my head around the proper code and nothing I have found through searching has worked so far.

    Can someone help me with this please?
    My site: http://www.lissyhunnybee.com/discussions/

    I have the latest versions of both wordpress and bbpress and am using the Darling theme which is a child theme of Genesis/Studio Press.

    Thanx in advance 🙂

Viewing 11 replies - 1 through 11 (of 11 total)
  • @lissyhunnybee

    Participant

    I would also like to move the breadcrumbs above the title lol

    @casiepa

    Moderator

    Hi lissy,

    This is a nice one indeed … with the standard arguments of bbp_before_get_breadcrumb_parse_args I don’t seem to get to display the text correctly (without being part of the ‘home’).

    Let me see if I find something and will add it to my toolkit too.

    Pascal.

    @lissyhunnybee

    Participant

    Thanx so much 🙂

    @robkk

    Moderator

    Here is a function to show the You Are Here: text.

    function rkk_breadcrumb_text() {
        $args['before']  = '<div class="bbp-breadcrumb"><p><span class="bbp-breadcrumb-text">You Are Here: </span>';
        return $args;
    }
    add_filter('bbp_before_get_breadcrumb_parse_args', 'rkk_breadcrumb_text');

    You may have to edit this function later if bbPress shows their breadcrumb items in a list though.

    @lissyhunnybee

    Participant

    Thank you SO much 🙂

    @lissyhunnybee

    Participant

    Hmmm, that code works but when I add it the code I added to change the seperator stops working. And if I add the function for the seperator after the code you gave me that one then stops working lol

    Here is the function I am using for the seperator, maybe they need to be combined somehow to work properly together?

    //* Change BBPress Breadcrumb Seperator
    function custom_bbp_breadcrumb() {
        $args['sep'] = ' / ';
        return $args;
    }
    
    add_filter('bbp_before_get_breadcrumb_parse_args', 'custom_bbp_breadcrumb' );

    @lissyhunnybee

    Participant

    Never mind, found my answer LOL just had to change one little bit 🙂

    //* Change BBPress Breadcrumb Seperator
    function filter_bbPress_breadcrumb_separator() {
    $sep = ' / ';
    return $sep;
    }
    
    add_filter('bbp_breadcrumb_separator', 'filter_bbPress_breadcrumb_separator');

    @robkk

    Moderator

    Hmm that is weird adding the breadcrumb like this worked for me. Either function you use is fine though.

    function rkk_breadcrumb_text() {
        $args['before']  = '<div class="bbp-breadcrumb"><p><span class="bbp-breadcrumb-text">You Are Here: </span>';
        $args['sep'] = ' / ';
        return $args;
    }
    add_filter('bbp_before_get_breadcrumb_parse_args', 'rkk_breadcrumb_text');

    @lissyhunnybee

    Participant

    I think because I had two separate functions both using bbp_before_get_breadcrumb_parse_args one cancelled out the other so changing that section worked. I prefer having it all in one though. Thanx so much for all your help 🙂

    @casiepa

    Moderator

    @lissyhunnybee

    If you don’t want to add yourself all the functions for the breadcrum, you can find them also in my bbP Toolkit plugin (https://wordpress.org/plugins/bbp-toolkit/).

    Pascal.

    @lissyhunnybee

    Participant

    Thank you 🙂

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