Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $taxonomy = 'product_cat';
- $orderby = 'name';
- $show_count = 0; // 1 for yes, 0 for no
- $pad_counts = 0; // 1 for yes, 0 for no
- $hierarchical = 1; // 1 for yes, 0 for no
- $title = '';
- $empty = 0;
- $args = array(
- 'taxonomy'=> $taxonomy ,'parent' => 0
- );
- $all_categories = get_categories( $args );
- foreach ($all_categories as $cat) {
- if($cat->category_parent == 0) {
- $category_id = $cat->term_id;
- echo '<br /><a href="'. get_term_link($cat->slug, 'product_cat') .'">'. $cat->name .'</a>';
- }} ?>
Add Comment
Please, Sign In to add comment