I successfully updated the existing code to calculate the total number of messages in a specific tag, and then print the amount. I have combined this together based on an existing snippet and although it works, I understand that it is very inefficient.
Ideally, it would be great if I could count the number of messages in all tags and return the total number, so I would not have to make hard codes $term_name.
I know there is a loop somewhere ... This is my first time I really do PHP, so when it is interesting, it reminds me that I have a lot to learn.
<?php
$taxonomy = "post_tag";
$term_name = 'Cookies';
$term = get_term_by('name', $term_name, $taxonomy);
$term_name1 = 'Juice';
$term1 = get_term_by('name', $term_name1, $taxonomy);
$term_name2 = 'Milk';
$term2 = get_term_by('name', $term_name2, $taxonomy);
echo ($term->count + $term1->count + $term2->count);
?>
: , , . . , , , , , 20000 .