Tagged: 

Viewing 6 posts - 31 through 36 (of 36 total)
  • Author
    Posts
  • #794690

    Hi,
    Yes, your example has not an parent category because the content is not all ready.
    But my example from post: https://kriesi.at/support/topic/breadcrum-shows-all-categories-off-an-portfolio-item/#post-793221 *is* assigned to an parent category and I show you that with link *and’* images and description and I show you with this example that the breadcrumb wotk not right. Why you post me an other example instaed work with this korrekt example?

    • This reply was modified 7 years, 7 months ago by Mike61.
    #795290

    Hi,

    Please check the portfolio item carefully. No parent category is assigned to it. You can’t display a category that is not actually assigned to a portfolio item or a post.

    View post on imgur.com

    Best regards,
    Ismael

    #795730

    Hi Ismael,

    ah ok.
    I have assigned the parent category “Produktzuordnung” to http://launch1702.allresist.de/portfolio-item/verduenner-ar-300-12/
    but it don’t work?!
    https://www.exusu-design.de/_data/parent.png

    #796403

    Hi,

    We modified the code in the functions.php file:

    // Anpassung Breadcrub ----------------------------------------------------------------------------------------------------
    function avia_change_breadcrumb($trail) {
    	if(is_singular('portfolio'))
    	{
    		global $post;
    
    		$home  = $trail[0];
    		$last  = array_pop($trail);
    		$terms = get_the_terms($post->ID, 'portfolio_entries');
    		$ancestors = get_ancestors( $terms[0]->term_id, 'portfolio_entries', 'taxonomy' );
    		$parent = get_term( $ancestors[0], 'portfolio_entries' );
    		unset($trail);
    
    		$trail[0] = $home;
    
    		if(!empty($parent))
    		{	
    			$link = '<a href="'.get_term_link($parent->term_id, $parent->taxonomy).'">'.ucfirst($parent->name).'</a>';
    			$link = preg_replace('!rel=".+?"|rel=\'.+?\'|!',"", $link);
    			$link = str_replace('<a ', '<a rel="v:url" property="v:title" ', $link);
    			$trail[1] = '<span typeof="v:Breadcrumb">'.$link.'</span>';
    		}
    
    		$trail['trail_end'] = $last;
    	}
    	return $trail;
    }
    
    add_action('after_setup_theme','avia_remove_portfolio_breadcrumb');
    function avia_remove_portfolio_breadcrumb(){
    	remove_filter('avia_breadcrumbs_trail','avia_modify_breadcrumb');
    	add_filter('avia_breadcrumbs_trail', 'avia_change_breadcrumb', 100, 1);
    }

    Best regards,
    Ismael

    #796421

    Hi,

    this looks good! It seams you have solve this problem.
    Thank you very mutch, great service!

    Best regards
    Mike

    #797025

    Hi,

    Glad we could help. We’ll close the thread now. Please feel free to open a new thread for more inquiries. :)

    Best regards,
    Ismael

Viewing 6 posts - 31 through 36 (of 36 total)
  • The topic ‘Breadcrum shows *all* Categories off an Portfolio Item’ is closed to new replies.