How to count post type that has a particular term?

$items = get_posts( array(
    'post_type'   => 'inventory',
    'numberposts' => -1,
    'taxonomy'    => 'status',
    'term'        => 'in-stock'
    ) );

$count =  count( $items );
echo $count;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)