Skip to:
Content
Pages
Categories
Search
Top
Bottom

$args['include_current'] = false; breadcrumb doesn't work on replies


  • demonboy
    Participant

    @demonboy

    I have added this code to my functions.php file

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

    … but that last argument only works for the original post, which returns something like this:

    Forums › Assignment Submissions ›

    On the replies underneath it includes the current location, something like this:

    Forums › Assignment Submissions › Assignment 24: 1st 24 hours in Crown Point, Tobago

    You can see this in action here.

    How do I remove that last part in the replies?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hmmmm…. Adding breadcrumbs to the ‘author’ details of topics and replies, that’s different, haven’t seen that done before 🙂

    Not sure if at the end of this I will have any form of an eloquent solution here for you…

    Technically it is actually working for you as the ‘include_current’ is the actual reply, not the topic, thus I presume if you set it to true you results would be:

    Forums › Assignment Submissions › Assignment 24: 1st 24 hours in Crown Point, Tobago > 3256
    Where the 3256 is the ID of the first reply in your thread linked above…

    And if you set it to true your breadcrumb for the first post, i.e. the actual topic would be:
    Forums › Assignment Submissions › Assignment 24: 1st 24 hours in Crown Point, Tobago

    The reasoning is that the breadcrumb function goes looking for ‘ancestors’ which includes the parent topic and any parent forums or categories in the hierarchy tree.

    You could do something like this, downside is you still have a extra > separator that you cannot hide without hiding all of them…

    a.bbp-breadcrumb-topic {
    display: none;
    }
    

    The alternative method would be to not use breadcrumbs at all for this and use something like this for the ‘parent’ forum link:

    <a href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a>


    demonboy
    Participant

    @demonboy

    Hi Stephen, thanks for the prompt and comprehensive reply. I want to include breadcrumbs because this forum is used by writers and authors who are more comfortable with pen and paper than they are a computer. Navigation has to be straightforward and obvious.

    Your simple CSS works well and I’m not worried about the additional ‘›’, I can live with that. I’ve implemented it and it looks good, thank you.

    Awesome, glad you have a fix your happy with 🙂

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