Help with creating proper breadcrumbs

I really love the ease of your themes, especially since I'm an non-coder/programmer. Though unfortunately I spend hours trying to figure things out what a real coder could do in 15 minutes and now I give up. One thing this theme doesn't have, unless I missed it, is the ability to have breadcrumbs, so I added it myself and place the code in the footer:

<code><div id="bodybread"><br />
<ul id="breadcrumb"></p>
<li><a href="/" title="Home"><img src="" alt="Home" class="home" /></a></li>
<p><?php if ( !is_home() ) { ?></p>
<li><?php the_category(', ') ?></li>
<li><?php the_title(); ?></li>
<p><?php } ?></p>

right after this code in header.php

<code><?php include (TEMPLATEPATH . '/call-signup.php'); ?><br />
<?php if($bp_existed == 'true') { //check if bp existed ?><br />
<div class="out-content" id="content"></code>

to get this
and all works well except when in the members menu tab or activity tab and I get this:
and when I'm in my user's profile, it pulls up the last category I built and the last post posted, instead of a proper breadcrumb, so I get this:
It shouldn't say "Photography Books" etc., I want it to say either profile or something appropriate.
When I'm at a blog post, it works:
and on a page, like the about page, it works great too, I get this:

(forgot how to upload images on here, swear I was able to do it before)
So any help on the proper code is greatly appreciated as this site, with your theme and support, is turning out fabulous. Thanks, rg

  • Mason
    • DEV MAN’s Sidekick

    Rolando, I like it man. You're going for it and the site is really coming along!

    Easiest way to get this done for you is to "steal" from Tammie's awesome bp-daily theme. :stuck_out_tongue:

    You're gonna want to grab lines 344-403 from custom-functions.php in bp-daily ( it's called function bpbreadcrumbs() ) and paste these lines at the bottom of your functions.php file. There's space at the bottom of this file, just be sure and do it before the closing "?>" tag.

    That being complete, go back to the exact spot in your header.php file and where you entered your breadcrumb navigation code (line 240 or so) you're going to replace what you had previously with this:

    <div id="breadcrumb">
    <?php if( $bp_existed == 'true' ) { //check if bp existed ?>
    <?php bpbreadcrumbs(); ?>
    <?php } else { // if not bp detected..let go normal ?>
    <?php wpbreadcrumbs(); ?>
    <?php } ?>

    That was also stolen from Tammie's bp-daily theme, but she's normally pretty cool about this sorta thing. :smiley:

    This will only work because we have buddypress enabled. If you disable buddypress the breadcrumb component will not function.

  • rolandogomez
    • Design Lord, Child of Thor

    Thanks, that was huge help! I did have to add "bp_ to the is_page part: // Current page
    if (bp_is_page() || is_single()) {
    $title = get_the_title();
    if ($title != ""){
    echo '<li class="breadcrumbs">'.get_the_title().'';
    and also change my style sheet names to match. Works like a charm. Thanks to both you and Tammie, you guys/gal rock! rg.

  • Tammie
    • WordPress Wizard

    @rolandogomez: Feel free to use the wp breadcrumbs also. Not sure about the adding bp_ as coming to the party late but both those functions work out of the box or should.

    @masonjames: Yep they are there for anyone to use so all is cool :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.