Skip to content

Instantly share code, notes, and snippets.

@energy0m
Last active December 20, 2015 07:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save energy0m/6095181 to your computer and use it in GitHub Desktop.
Save energy0m/6095181 to your computer and use it in GitHub Desktop.
this is the product-output that gores with the last one...
<?php
global $my_cats;
foreach ($my_cats as $cat) {
//print_r($cat);
$category_id = $cat->term_id;
$thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true );
$image = wp_get_attachment_url( $thumbnail_id );
echo '<li class="product type-product status-publish hentry first instock"><div class="product-image"><a href="'. get_term_link($cat->slug, 'product_cat') .'"><img src="'.$image.'" alt="'. $cat->name .'"/></a></div><div class="product-details"><h3><a href="'. get_term_link($cat->slug, 'product_cat') .'">'. $cat->name .'</a></h3></div></li>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment