×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Peter Goudkamp
Added: Mar 2, 2015 7:08 PM
Views: 7
Tags: no tags
To get the link of the category in woocommerce
  1. if ( $terms = wc_get_product_terms( $post->ID, 'product_cat' ) ) { $main_term = $terms[0]; echo $before . '<a href="' . get_term_link( $main_term ) . '" class="btn btn-default">Terug naar overzicht</a>'; }