我正在尝试显示邮政编码(X) 在每一单上。php,基于该帖子在其类别中的数量,然后是帖子总数(Y) 在类别中。因此,如果我的“照片”类别中有10篇帖子,那么最新的帖子应该是“1/10”。
I found this solution for Y:
<?php
$category = get_the_category();
echo $category[0]->category_count;
?>
This solution almost does what I want for X, 但它不是基于类别,而是包括所有帖子:http://wordpress.org/support/topic/show-post-number#post-1294235有人能帮忙吗?:-)