Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Many of my posts are in Multiple Main Categories / Sub-Categories, so the way I currently have My Breadcrumbs programmed looks really confusing. It looks like this:

Main Category > Main Category > Sub Category > Sub Category

What I want to program is to have the breadcrumbs look like this:

Main Category 1 > Sub Category || Main Category 2 > Sub Category (of Main Category 2)

I can't quite figure out how to program it like that

share|improve this question
2  
You should start accepting answers and mark them as solved. No one will help if you got such a low accept rate (and I read from your comments that some of the As worked). – kaiser Aug 15 '11 at 23:23
Are you using a plugin to create your breadcrumbs? – GavinR Aug 16 '11 at 1:59
I don't understand why I have such a low accept rate, i've accepted an answer on nearly every question i've ever asked. – Jordash Aug 17 '11 at 1:43

closed as too localized by toscho Jul 13 '12 at 19:43

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

insert this into functions.php

function lilumi_breadcrumbs() {

   $delimiter = ' » ';
   echo '<div id="crumbs">';
   global $post;

    $cat = get_the_category();
      foreach ($cat as $k) {
         $stack = get_category_parents($k, TRUE, '$');
         $cats = explode ('$', $stack );
         array_pop($cats);
         echo join($delimiter, $cats ).' || ';
        }

    echo '</div>';


} // end lilumi_breadcrumbs()

And insert this code in single.php

 if (function_exists('lilumi_breadcrumbs')) lilumi_breadcrumbs(); 
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.