Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Count topics with specific tag

@phamdacloc

Participant

With a combination of two methods, I was able to get the number of topics per tag. These methods query the taxonomies of bbPress’ topic-tag:

$tagList = get_the_terms($post->ID, bbp_get_topic_tag_tax_id());

The output of $tagList is as follow and ‘count’ is what i’m interested in:

{
term_id: 24
name: “Presidential”
slug: “presidential”
term_group: 0
term_taxonomy_id: 24
taxonomy: “topic-tag”
description: “”
parent: 0
count: 3
object_id: 155
filter: “raw”
}

Hope this helps others.

Skip to toolbar