This topic has 8 replies, 2 voices, and was last updated 9 years by sharmstr.

  • Author

    Tagged: 

  • #43612
     morethanthesky
    Participant

    Is there any way to hack the breadbrumbs so that I can add a root site before “Home”? Also can I change the word “home” in what it perceives as the root home page to something else?

    Thank you!

    #43649
     morethanthesky
    Participant

    So I’ve found in kleo-framework/lib/function-breadcrumb.php the $defaults array in which there is a ‘network’ switch, which is what I was looking for. It’s set to ‘false’ by default, but when I set it to ‘true’, it adds the network home, but I don’t see in the front end where I can set this flag? Don’t want to edit the core files since an upgrade will wipe the changes, but I don’t see in the admin options where to tell the breadcrumbs to be for a network.

    Thanks!

    #43659
     sharmstr
    Moderator

    You dont need to edit it. If you look a few lines down, you can filter it.

    Check this out. Tailor to your needs. http://wordpress.stackexchange.com/questions/104094/how-do-i-edit-a-plugins-core-properly

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #43662
     morethanthesky
    Participant

    Oh my gosh I love you, you’re awesome.

    I do have a question though. The syntax has changed a little since that page you’ve referred me to. It’s now this:

    $this->args = apply_filters(‘breadcrumb_trail_args’, wp_parse_args($args, $defaults));

    How would I edit this in my functions.php to reflect the new syntax?

    function wpse_104094_breadcrumb_trail_args( $args ) {
    $args[‘network’] = ‘true’;
    return $args;
    }

    add_filter( ‘breadcrumb_trail_args’, ‘wpse_104094_breadcrumb_trail_args’ );

    #43663
     morethanthesky
    Participant

    Per this page, it should work as is, no? But it doesn’t work on my site, so I’m clearly missing something

    http://codex.wordpress.org/Function_Reference/wp_parse_args

    #43665
     morethanthesky
    Participant

    Ok I figured it out. Was passing ‘true’ instead of true. Took away the quotes and it worked. Knew it would be something small.

    Thank you again for your help today!

    #43673
     sharmstr
    Moderator

    I’ve never played around with a network install so I cant test it for you. But if I add something ridiculous like

    COPY CODE
    
    function wpse_104094_breadcrumb_trail_args( $args ) {
        $args['before'] = 'Yo';
        $args['network'] = true;
        return $args;
    }
    
    add_filter( 'breadcrumb_trail_args', 'wpse_104094_breadcrumb_trail_args' );
    

    I also put a default value in ‘before’ and it used Yo instead of my default value. So, it is filtering the defaults.

    You can see by adding this below the apply_filters statement.

    COPY CODE
    
    print_r($this->args);
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    Attachments:
    You must be logged in to view attached files.
    #43675
     sharmstr
    Moderator

    ahhh. good. I’m glad you sorted it.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #43676
     sharmstr
    Moderator

    btw – Last night I spent almost an hour debugging a function. Turns out I had filed instead of field. So frustrating.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?