• I’m using Comment Remix plugin. It allows users to create tags for their comments. When a tag is created, a new term is created in the wpdb. The term is a category with the term taxonomy ‘comment_tag’. I need to query the terms that are only related to the post where term taxonomy is ‘comment_tag’ and then be able to display the query as an array. I tried this, and it pinpoints the ID numbers of the terms, but I need to display the term name, not the term ID number. Any ideas?

    $termquery = get_the_category
    ("
    SELECT $wpdb->name FROM terms
    WHERE $wpdb->term_taxonomy.taxonomy = 'comment_tag'
    ");
    
    $displayterms = $wpdb->get_col($termquery['$name']);
    echo json_encode($displayterms);

  • The topic ‘How to get category term name where taxonomy is comment_tag?’ is closed to new replies.