I would like to display categories of a custom post type but not all of them. I'm using shortcode like this [categories exclude="56","59"] but it doesn't work. Can we exclude some categories in shortcode?
function theme_shortcode_categories( $atts, $content = null) {
extract( shortcode_atts( array(
'categoriespostcount' => 'on',
'categorieshierarchy' => 'on',
), $atts ) );
$h = $categorieshierarchy == 'on'? "1" : "0";
$c = $categoriespostcount == 'on'? "1" : "0";
$cat_args = array('orderby' => 'name', 'post_type' => 'theme_portfolio_image', 'taxonomy' => 'theme_portfolio_categories','show_count' => $c, 'operator' => 'NOT IN', 'hierarchical' => $h, 'echo' => 0);
return wp_list_categories( $cat_args );
}
add_shortcode( 'categories', 'theme_shortcode_categories' );