Tuesday 2 September 2014

WordPress List Of Categories

<?php wp_list_categories( $args ); ?>

<?php $args = array(
    'show_option_all'    => ,
    'orderby'            => 'name',
    'order'              => 'ASC',
    'style'              => 'list',
    'show_count'         => 0,
    'hide_empty'         => 1,
    'use_desc_for_title' => 1,
    'child_of'           => 0,
    'feed'               => ,
    'feed_type'          => ,
    'feed_image'         => ,
    'exclude'            => ,
    'exclude_tree'       => ,
    'include'            => ,
    'hierarchical'       => true,
    'title_li'           => __( 'Categories' ),
    'show_option_none'   => __('No categories'),
    'number'             => NULL,
    'echo'               => 1,
    'depth'              => 0,
    'current_category'   => 0,
    'pad_counts'         => 0,
    'taxonomy'           => 'category',
    'walker'             => 'Walker_Category' ); ?>


$customPostTaxonomies = get_object_taxonomies('products');

if(count($customPostTaxonomies) > 0)
{
     foreach($customPostTaxonomies as $tax)
     {
    $args = array(
           'orderby' => 'name',
         'show_count' => 0,
         'pad_counts' => 0,
         'hierarchical' => 1,
         'taxonomy' => $tax,
         'title_li' => ''
        );

    wp_list_categories( $args );
     }
}

No comments:

Post a Comment