Adding an additional argument to breadcrumbs for MultiSite

Community Forums Forums General Discussion Adding an additional argument to breadcrumbs for MultiSite

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  braddalton 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #92204

    FireSamurai
    Participant
    Post count: 42

    I have a multisite setup for a school district where each department has their own site within the network install. I would like to use the Genesis breadcrumbs functionality but I need to modify it slightly so that the main site on the network install shows up as “Home” and the default “Home” shows up as the name of the site. I’ve already figured out the second part, but I have yet to figure out how to display the multisite name before ['Home']. I figure the best way to do this is to add an extra argument to the breadcrumbs arguments array. This is what I’ve got so far, I’m just not sure how to get the breadcrumbs to recognize the new argument.

    //* Modify breadcrumb arguments
    add_filter( 'genesis_breadcrumb_args', 'custom_breadcrumb_args' );
    function custom_breadcrumb_args( $args ) {
    	global $blog_id;
    	
    	$ms_home = '<a href="' . network_home_url() . '">Home</a>';
    	$current_blog_details = get_blog_details( array( 'blog_id' => $blog_id ) );
     
    	$args['ms_home'] = $ms_home;
    	$args['home'] = $current_blog_details->blogname;
    	$args['labels']['prefix'] = 'You are here: ';
    return $args;
    }

    If anybody is aware of a better way to do this, I’m open to suggestions.


    My Websites: TheCookingDish.com | ChrisMower.com
    Connect with me: Facebook | Pinterest | Twitter | Google +

    • This topic was modified 7 months, 1 week ago by  FireSamurai.
    • This topic was modified 7 months, 1 week ago by  FireSamurai. Reason: Clarification edit
    • This topic was modified 7 months, 1 week ago by  FireSamurai.
    • This topic was modified 7 months, 1 week ago by  FireSamurai. Reason: Clarification edit
    http://localhost
    #92435

    braddalton
    Participant
    Post count: 9944

    How about trying the is_main_site() conditional tag?


    #92495

    FireSamurai
    Participant
    Post count: 42

    Thanks Brad! I attempted using that but couldn’t get the crumb to display even still. Likely, I’m not adding the new argument to the array correctly.


    My Websites: TheCookingDish.com | ChrisMower.com
    Connect with me: Facebook | Pinterest | Twitter | Google +

    #92592

    braddalton
    Participant
    Post count: 9944

    This is what i use http://wpsites.net/web-design/change-breadcrumbs-in-genesis/

    You could try adding the conditional check is_main_site() after the function and see if it works and then an else statement.

    Don’t have MS installed locally so can’t test.

    https://gist.github.com/braddalton/376d32169fec087a24d9


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

You must be logged in to reply to this topic.