Hi,
I would like to display a link to the product parent category on a single product page. It should be like a breadcrumb but it should only have the name of the parent category.
For example:
Product CAT 1
- Product X
- Product Y
When being on the product X page, a link should be displayed to Product CAT 1. Right now the breadcrumb looks like this:
Home » Shop » Product category slug » Product name
The Product category slug is always the same as it is the name configured at WooCommerce=>settings=>pages under 'Permalinks'. I think we should edit some code in the class-breadcrumb.php file located in abundance\framework\php\
This is some code of the original class-breadcrumb.php file that I use:
/* Open the breadcrumb trail containers. */
$breadcrumb = '<div class="breadcrumb breadcrumbs avia-breadcrumbs"><div class="breadcrumb-trail">';
/* If $before was set, wrap it in a container. */
if ( !empty( $before ) )
$breadcrumb .= '<span class="trail-before">' . $before . '</span> ';
/* Wrap the $trail['trail_end'] value in a container. */
if ( !empty( $trail['trail_end'] ) )
$trail['trail_end'] = '<span class="trail-end">' . $trail['trail_end'] . '</span>';
/* Format the separator. */
if ( !empty( $separator ) )
$separator = '<span class="sep">' . $separator . '</span>';
/* Join the individual trail items into a single string. */
$breadcrumb .= join( " {$separator} ", $trail );
/* If $after was set, wrap it in a container. */
if ( !empty( $after ) )
$breadcrumb .= ' <span class="trail-after">' . $after . '</span>';
/* Close the breadcrumb trail containers. */
$breadcrumb .= '</div></div>';
}
/* Allow developers to filter the breadcrumb trail HTML. */
$breadcrumb = apply_filters( 'avia_breadcrumbs', $breadcrumb );
/* Output the breadcrumb. */
if ( $echo )
echo $breadcrumb;
else
return $breadcrumb;
} // End avia_breadcrumbs()
Any ideas to achieve this?
Thanks and keep up the good work. I love this theme!














