Tagged: ismael
-
AuthorPosts
-
May 17, 2017 at 8:18 am #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.
May 18, 2017 at 7:38 am #795290Hi,
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.
Best regards,
IsmaelMay 18, 2017 at 9:45 am #795730Hi 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.pngMay 19, 2017 at 8:00 am #796403Hi,
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,
IsmaelMay 19, 2017 at 9:23 am #796421Hi,
this looks good! It seams you have solve this problem.
Thank you very mutch, great service!Best regards
MikeMay 20, 2017 at 3:53 pm #797025 -
AuthorPosts
- The topic ‘Breadcrum shows *all* Categories off an Portfolio Item’ is closed to new replies.