Guest User

Untitled

a guest
Apr 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. $args = array(
  2. 'number' => $number,
  3. 'orderby' => $orderby,
  4. 'order' => $order,
  5. 'hide_empty' => $hide_empty,
  6. 'include' => $ids
  7. );
  8.  
  9. $product_categories = get_terms( 'product_cat', $args );
  10. foreach( $product_categories as $cat ) { echo $cat->name; }
  11.  
  12. $args = array(
  13. 'number' => $number,
  14. 'orderby' => $orderby,
  15. 'order' => $order,
  16. 'hide_empty' => $hide_empty,
  17. 'include' => $ids
  18. );
  19.  
  20. $product_categories = get_terms( 'product_cat', $args );
  21.  
  22. foreach( $product_categories as $cat ) {
  23. echo $cat->name.' ('.$cat->count.')';
  24. }
  25.  
  26. <ul class="Category-list">
  27.  
  28. <?php
  29.  
  30. $wcatTerms = get_terms('product_cat', array('hide_empty' => 0, 'parent' =>0));
  31. $count = $category->category_count;
  32.  
  33. foreach($wcatTerms as $wcatTerm) : ?>
  34. <?php
  35. $thumb_id = get_woocommerce_term_meta( $wcatTerm->term_id, 'thumbnail_id', true );
  36. $term_img = wp_get_attachment_url( $thumb_id );
  37. ?>
  38. <li><a href="<?php echo get_term_link( $wcatTerm->slug, $wcatTerm->taxonomy ); ?>"><?php echo $wcatTerm->name; ?>(<?php echo $wcatTerm->count;?>)</a></li>
  39. <?php endforeach; ?>
  40. </ul>
  41. </div>
Add Comment
Please, Sign In to add comment