• Hy to all,
    I propose this change in order to properly capture the structure of the categories even when you have 3 levels

    breadcrumbs_navxt_class.php
    row: 447

    //Now find which one has a parent, pick the first one that does
    $bcn_use_term = key($bcn_object);
    $aID=array();
    $aPAR=array();
    foreach($bcn_object as $key=>$object)
    {
    $aID[] =$object->term_id;
    $aPAR[]=$object->parent;

    //We want the first term hiearchy
    /*TO DELETE
    if($object->parent > 0)
    {
    $bcn_use_term = $key;
    //We found our first term hiearchy, can exit loop now
    //break;
    }
    */
    }
    /*
    ID | PARENT
    4 | 0
    2 | 4
    15 | 2
    */
    $aDiff=array_diff($aID,$aPAR);
    $bcn_use_term = current($aDiff);

    http://ww.wp.xz.cn/extend/plugins/breadcrumb-navxt/

Viewing 1 replies (of 1 total)
  • Plugin Author John Havlik

    (@mtekk)

    What problem are you running into that would require this modification? Breadcrumb NavXT is not restricted in the number of categories in a trail. Note that you need to ensure that a post is an explicit member of only the deepest child of a category hierarchy, and not an explicit member of multiple categories in the a hierarchy. There is no reason to have a post an explicit member of multiple categories in the same hierarchy since it will be an implicit member of the parent categories of what ever child category is selected.

    Also, the use of array_diff() adds a substantial processing penalty to the plugin, which I am not willing to incur unless absolutely necessary as WordPress is already CPU bound.

Viewing 1 replies (of 1 total)

The topic ‘GET ALL CATEGORIES HACK’ is closed to new replies.