Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $args=array(
- 'public' => true,
- '_builtin' => false
- );
- $output = 'names'; // or objects
- $operator = 'and';
- $taxonomies=get_taxonomies($args,$output,$operator);
- if ($taxonomies) {
- foreach ($taxonomies as $taxonomy ) {
- $terms = get_terms($taxonomy);
- foreach ( $terms as $term) {
- ?>
- <li><br><a href="#"><input type="checkbox" name="profile[]" value=""><?php echo $term->name; ?> <br/></a></li>
- <?php
- }
- }
- }
- ?>
- $terms = get_terms([
- 'taxonomy' => $taxonomy,
- 'hide_empty' => false,
- ]);
- <?php $wcatTerms = get_terms('product_cat', array('hide_empty' => 0, 'parent' =>0));
- foreach($wcatTerms as $wcatTerm) :
- ?>
- <ul>
- <li>
- <a href="<?php echo get_term_link( $wcatTerm->slug, $wcatTerm->taxonomy ); ?>"><?php echo $wcatTerm->name; ?></a>
- <ul class="megaSubCat">
- <?php
- $wsubargs = array(
- 'hierarchical' => 1,
- 'show_option_none' => '',
- 'hide_empty' => 0,
- 'parent' => $wcatTerm->term_id,
- 'taxonomy' => 'product_cat'
- );
- $wsubcats = get_categories($wsubargs);
- foreach ($wsubcats as $wsc):
- ?>
- <li><a href="<?php echo get_term_link( $wsc->slug, $wsc->taxonomy );?>"><?php echo $wsc->name;?></a></li>
- <?php
- endforeach;
- ?>
- </ul>
- </li>
- </ul>
- <?php
- endforeach;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement