• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Adding an additional argument to breadcrumbs for MultiSite

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved

Tagged: breadcrumbs, multisite

  • This topic has 3 replies, 2 voices, and was last updated 9 years, 7 months ago by Brad Dalton.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • February 24, 2014 at 4:00 pm #92204
    FireSamurai
    Member

    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.

    http://localhost
    February 26, 2014 at 1:55 am #92435
    Brad Dalton
    Participant

    How about trying the is_main_site() conditional tag?


    Tutorials for StudioPress Themes & WooCommerce.

    February 26, 2014 at 12:06 pm #92495
    FireSamurai
    Member

    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.

    February 26, 2014 at 10:05 pm #92592
    Brad Dalton
    Participant

    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


    Tutorials for StudioPress Themes & WooCommerce.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble