• Thank you for this very helpful plugin. I’m configuring a WordPress site using the Genesis Minimum Pro theme with BuddyPress and bbPress. Genesis and bbPress have their own breadcrumb features which can be made to look identical using CSS. But BuddyPress does not come with this feature. I want a consistent look across the site and so it was important to implement breadcrumbs on the BuddyPress pages as well. This plugin works, but I had to make some modifications to the theme and to the plugin.

    My first challenge was installing the plugin under Genesis. Pasting the function call into my BuddyPress header.php did not work because Genesis handles the output. What I wound up doing was customizing the Genesis breadcrumb function and putting the Breadcrumbs Everywhere function call there. I won’t claim that my code is terribly streamlined, but here is what I did:

    remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
    add_action( 'genesis_after_header', 'breadcrumbs_with_wrapper' );
    function breadcrumbs_with_wrapper() {
    
    	if ( !is_home() /* && (!is_archive() || !is_bbpress() )*/ ){
    
    		/* Create container */
    
    		printf( '<div %s>', genesis_attr( 'breadcrumb-container' ) );
    		genesis_structural_wrap( 'breadcrumb-container' );
    
    		/* Code from Genesis breadcrumb function to output breadcrumbs */
    
    		if (
    			( ( 'posts' === get_option( 'show_on_front' ) && is_home() ) && ! genesis_get_option( 'breadcrumb_home' ) ) ||
    			( ( 'page' === get_option( 'show_on_front' ) && is_front_page() ) && ! genesis_get_option( 'breadcrumb_front_page' ) ) ||
    			( ( 'page' === get_option( 'show_on_front' ) && is_home() ) && ! genesis_get_option( 'breadcrumb_posts_page' ) ) ||
    			( is_single() && ! genesis_get_option( 'breadcrumb_single' ) ) ||
    			( is_page() && ! genesis_get_option( 'breadcrumb_page' ) ) ||
    			( ( is_archive() || is_search() ) && ! genesis_get_option( 'breadcrumb_archive' ) ) ||
    			( is_404() && ! genesis_get_option( 'breadcrumb_404' ) ) ||
    			( is_attachment() && ! genesis_get_option( 'breadcrumb_attachment' ) )
    		)
    			return;
    
    		if ( function_exists( 'bcn_display' ) ) {
    			echo '<div class="breadcrumb" itemprop="breadcrumb">';
    			bcn_display();
    			echo '</div>';
    		}
    		elseif ( function_exists( 'yoast_breadcrumb' ) ) {
    			yoast_breadcrumb( '<div class="breadcrumb">', '</div>' );
    		}
    		elseif ( function_exists( 'breadcrumbs' ) ) {
    			breadcrumbs();
    		}
    		elseif ( function_exists( 'crumbs' ) ) {
    			crumbs();
    		}
    		elseif ( function_exists( 'breadcrumbs_everywhere' ) ) {
    			breadcrumbs_everywhere();
    		}
    		else {
    			genesis_breadcrumb();
    		}
    
    		/* Close the container */
    
    		genesis_structural_wrap( 'breadcrumb-container', 'close' );
    		echo '</div>';
    	}
    }

    This code works in my site, which consists of WP 3.6.1, BP 1.8.8, bbPress 2.4.1, with the bbPress Genesis Extend plugin by Jared Atchison. (I am not using the Genesis Connect Plugin for BuddyPress. BP versions 1.7 and beyond seem to work without it.)

    http://wordpress.org/plugins/breadcrumbs-everywhere/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter lflier

    (@lflier)

    My second challenge was modifying the plugin to get the breadcrumbs to display on my Member and Activity pages. When I installed the plugin on a clean install of BuddyPress using the stock BP theme, the breadcrumbs showed up everywhere they were supposed to. But in my theme, they did not appear on the Member and Activity pages; only on the user pages.

    Modifying the plugin with the code below did the trick:

    if ( bp_is_user() && !bp_is_register_page() ) {
    echo $startpages . " $divider " . '<a href="' . $homeurl . '/' . $page1 . '/">' . ucwords($page1) . '</a>' . " $divider " . '<a href="' . $bp->displayed_user->domain . '">' . ucwords($bp->displayed_user->fullname)  . '</a>' . " $divider " . ucwords($bp->current_component)  . "";
    } elseif (bp_is_current_component ( 'activity' ) || bp_is_current_component ( 'members' ) ){
    echo $startpages . " $divider " .  get_the_title()  . "";
    }
    Plugin Author betsyk

    (@betsyk)

    Thanks for taking the time to share this information, lflier. It will be very helpful for Genesis themers.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Breadcrumbs Everywhere with Genesis and BP 1.8.1’ is closed to new replies.