I have two urls, and I want to know how many posts will be displayed there, when I click them. The goal is to show the visitor in the navigation of those urls, how many postings are found there.
As far as I can analyze those urls I would say it’s about a category and then about a category and a tag. But pleas tell me if I am wrong.
Here are the two Urls, which actually end up in a blog-roll page (pseudo code):
http://site_url()/category/<category-name>/ and http://site_url()/category/<category-name>/<tag-name>
category is the string
Is my question somehow clear?
Do I have to use
You could run a new instantiation of WP_Query.
$query = new WP_Query([ 'category_name' => '<category_slug>', 'tag' => '<tag_slug>', 'fields' => 'ids', // To minimize the query, since we just need a count ]);
Then all you need to do is reference
Hope that helps. I don’t think there is a better way unfortunately.