Ready to get started?Download WordPress


Count number of times a taxonomy term has been used (3 posts)

  1. Henry
    Posted 2 years ago #

    I would like to display the number of times a specific term from a custom taxonomy has been used.

    Is this possible? Any idea how to do this?


  2. http://codex.wordpress.org/Function_Reference/get_term

    extended from the example section:

    $term = get_term( $term_id, $taxonomy );
    $count = $term->count;
  3. Henry
    Posted 2 years ago #


    Really appreciate you pointing me in the right direction. Building on what you wrote I came up with this which works for me:

    $taxonomy = "status";
    $term_name = 'active';
    $term = get_term_by('name', $term_name, $taxonomy);
    echo $term->count;

Topic Closed

This topic has been closed to new replies.

About this Topic