Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #185510

    Hi together,

    Maybe it seems to be that Enfold cannot deal with with sub-categories correctly in breadcrumb:

    http://www.rundumskinderzimmer.de/abstillen > Main catogory: baby , Sub-Category: stillen

    If I take a look into breadcrumb I only see the first level: “baby”

    Is there some quick fix to tell Enfol to also add “stillen” like home > baby > stillen ?

    Best regards
    Steffen

    #186060

    Hey tcoq!

    Yes it’s a limitation of the Enfold breadcrumb. We’ll improve it in the next version – for now open up /wp-content/themes/enfold/framework/php/class-breadcrumb.php and replace

    
    		if('post' == $post_type)
    		{
    			$category = get_the_category();
    			$ID = $category[0]->cat_ID;
    
    			 $parents = get_category_parents($ID, TRUE, '$$$', FALSE );
    			 $parents = explode("$$$", $parents);
    			 foreach ($parents as $parent_item)
    			 {
    			 	if($parent_item) $trail[] = $parent_item;
    			 }
    		}
    

    with

    
    		if('post' == $post_type)
    		{
    			$category = get_the_category();
    
                foreach($category as $cat)
                {
                    if(!empty($cat->parent))
                    {
                        $parents = get_category_parents($cat->cat_ID, TRUE, '$$$', FALSE );
                        $parents = explode("$$$", $parents);
                        foreach ($parents as $parent_item)
                        {
                            if($parent_item) $trail[] = $parent_item;
                        }
    
                        break;
                    }
                }
    		}
    

    Cheers!
    Peter

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Enfold RDF-Breadcrumb for rich snippets: No sub categories’ is closed to new replies.