Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. <?php
  2. $args=array(
  3. 'public' => true,
  4. '_builtin' => false
  5. );
  6. $output = 'names'; // or objects
  7. $operator = 'and';
  8. $taxonomies=get_taxonomies($args,$output,$operator);
  9. if ($taxonomies) {
  10. foreach ($taxonomies as $taxonomy ) {
  11. $terms = get_terms($taxonomy);
  12. foreach ( $terms as $term) {
  13. ?>
  14. <li><br><a href="#"><input type="checkbox" name="profile[]" value=""><?php echo $term->name; ?> <br/></a></li>
  15. <?php
  16. }
  17. }
  18. }
  19. ?>
  20.  
  21. $terms = get_terms([
  22. 'taxonomy' => $taxonomy,
  23. 'hide_empty' => false,
  24. ]);
  25.  
  26. <?php $wcatTerms = get_terms('product_cat', array('hide_empty' => 0, 'parent' =>0));
  27. foreach($wcatTerms as $wcatTerm) :
  28. ?>
  29. <ul>
  30. <li>
  31. <a href="<?php echo get_term_link( $wcatTerm->slug, $wcatTerm->taxonomy ); ?>"><?php echo $wcatTerm->name; ?></a>
  32. <ul class="megaSubCat">
  33. <?php
  34. $wsubargs = array(
  35. 'hierarchical' => 1,
  36. 'show_option_none' => '',
  37. 'hide_empty' => 0,
  38. 'parent' => $wcatTerm->term_id,
  39. 'taxonomy' => 'product_cat'
  40. );
  41. $wsubcats = get_categories($wsubargs);
  42. foreach ($wsubcats as $wsc):
  43. ?>
  44. <li><a href="<?php echo get_term_link( $wsc->slug, $wsc->taxonomy );?>"><?php echo $wsc->name;?></a></li>
  45. <?php
  46. endforeach;
  47. ?>
  48. </ul>
  49. </li>
  50. </ul>
  51. <?php
  52. endforeach;
  53. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement