Friday, March 15, 2013

Wordpress get child categories list passing parent category id

$args = array(
    'type'                     => 'post',
    'child_of'              => $cur_cat_id,
    'parent'                 => '',
    'orderby'              => 'name',
    'order'                   => 'ASC',
    'hide_empty'       => 1,
    'hierarchical'       => 1,
    'exclude'              => '',
    'include'               => '',
    'number'              => '',
    'taxonomy'          => 'category',
    'pad_counts'       => false
 );
$cat_child_data = get_categories( $args );

No comments:

Post a Comment