# Parent category counter

**URL:** https://meta.discourse.org/t/parent-category-counter/94635
**Category:** Support
**Created:** [August 13, 2018, 7:53pm UTC](https://meta.discourse.org/t/parent-category-counter/94635 "2018-08-13T19:53:59Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Joshua\_Kogan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joshua_kogan/32/127595_2.png) [@Joshua\_Kogan](https://meta.discourse.org/u/Joshua_Kogan)
#### Post date: [August 13, 2018, 7:53pm UTC](https://meta.discourse.org/t/parent-category-counter/94635/1 "2018-08-13T19:53:59Z")

</div>

**My site** : [www.sqrpgz.com](http://www.sqrpgz.com)

**My issue** : category drop-down menu shows parent categories with post/topic counts, but in the case of that parent category having sub-categories, the total posts/topics aren’t added to reflect the parent category’s total count. See images:

 ![21%20PM](https://global.discourse-cdn.com/meta/original/3X/2/8/28abb6557d9a95b570130907f6c4c648581dfc2c.png)

 ![38%20PM](https://global.discourse-cdn.com/meta/original/3X/7/8/78a681ba662ef72b47be8ddd02b2efcb51d3efca.png)

you can see that the parent “FE Open Exchange” has a zero count in the first image, but if selected, and sub-categories are viewed in the subcat drop-down menu, you can see that “FE Open Exchange” should show an accumulated total greater than zero. Showing zero confuses my users – they think it’s not worth clicking on the parent in such a case.

**My question** : can anyone tell me how to show the parent count equal to all subcategory counts added?

---

<div class="post-metadata">

### Author: ![Joshua\_Kogan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joshua_kogan/32/127595_2.png) [@Joshua\_Kogan](https://meta.discourse.org/u/Joshua_Kogan)
#### Post date: [August 14, 2018, 2:34pm UTC](https://meta.discourse.org/t/parent-category-counter/94635/2 "2018-08-14T14:34:58Z")

</div>

anyone have an idea? do i just need to kill the subcategories?

---

<div class="post-metadata">

### Author: ![Joshua\_Kogan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joshua_kogan/32/127595_2.png) [@Joshua\_Kogan](https://meta.discourse.org/u/Joshua_Kogan)
#### Post date: [August 17, 2018, 3:27pm UTC](https://meta.discourse.org/t/parent-category-counter/94635/3 "2018-08-17T15:27:01Z")

</div>

@sam do you have any idea why the parent category counter includes all subcategory counts on the “categories” page, but not in the category drop-down menu? How can this be fixed?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [August 17, 2018, 3:48pm UTC](https://meta.discourse.org/t/parent-category-counter/94635/4 "2018-08-17T15:48:33Z")

</div>

Are you sure this isn’t related to your theme?  
I’m using graceful theme by @awesomerobot and for me, the view is like this:

 ![Screenshot%20from%202018-08-17%2021-19-02](https://global.discourse-cdn.com/meta/original/3X/4/1/413df38c8ee0c8984ea4bc8f9a8732056d3729fd.png)  
This remains consistent with default theme as well.

---

<div class="post-metadata">

### Author: ![Joshua\_Kogan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joshua_kogan/32/127595_2.png) [@Joshua\_Kogan](https://meta.discourse.org/u/Joshua_Kogan)
#### Post date: [August 20, 2018, 10:40am UTC](https://meta.discourse.org/t/parent-category-counter/94635/5 "2018-08-20T10:40:21Z")

</div>

thanks @itsbhanusharma, but the category counts are working fine until i add sub/child categories – then the child categories are fine, but the parents are set to zero. i actually converted back to a default theme to double-check, but it’s still an issue. i was hoping someone would enlighten me as to either why, or even better, explain how i can change/fix it.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [August 20, 2018, 12:14pm UTC](https://meta.discourse.org/t/parent-category-counter/94635/6 "2018-08-20T12:14:33Z")

</div>

So I’m trying to reproduce your symptoms!  
in Your case, Counts are okay on a category but as soon as you add a sub category to it, the count changes to zero! right? or am I missing something here?

If what I described above is true then sorry but I can’t repro that behavior on latest so it’d be much better to have either a specific version number or better yet, try upgrading to latest by visiting /admin/upgrade on your forum and then see if it still persists.

Another way to test would be to visit the [safe mode](https://meta.discourse.org/t/53504?silent=true) and disabling all plugins and customization this can be done by appending /safe-mode to your forum link.

EDIT: I may be wrong but I visited your forum and found out that it is running version 2.0.3 (Are you on stable channel?) whereas most of the installs that I could test upon are on latest tests-passed (v2.1.0beta4) so maybe it had been fixed?

---

<div class="post-metadata">

### Author: ![Joshua\_Kogan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joshua_kogan/32/127595_2.png) [@Joshua\_Kogan](https://meta.discourse.org/u/Joshua_Kogan)
#### Post date: [August 20, 2018, 12:45pm UTC](https://meta.discourse.org/t/parent-category-counter/94635/7 "2018-08-20T12:45:46Z")

</div>

Thanks for the feedback! I just tried the /safe-mode option, and it still happens, so it must be a version-related issue. I’m using [Communiteq](https://www.communiteq.com) (formerly DiscourseHosting).net for hosting – they offer a stable version, and I’m not sure I can upgrade. Nonetheless, thank you for your help!

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [August 20, 2018, 3:36pm UTC](https://meta.discourse.org/t/parent-category-counter/94635/8 "2018-08-20T15:36:09Z")

</div>

> [@itsbhanusharma](#):
>
> Counts are okay on a category but as soon as you add a sub category to it, the count changes to zero! right? or am I missing something here?

That is not entirely correct.  
It does not “change to zero” , it only counts the topics in the subcategories, in this specific case there are no topics that are directly in the category itself.

I can reproduce this on stable, but indeed I’m not able to reproduce on tests-passed.

---

<div class="post-metadata">

### Author: ![Joshua\_Kogan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joshua_kogan/32/127595_2.png) [@Joshua\_Kogan](https://meta.discourse.org/u/Joshua_Kogan)
#### Post date: [August 20, 2018, 4:02pm UTC](https://meta.discourse.org/t/parent-category-counter/94635/9 "2018-08-20T16:02:00Z")

</div>

Thanks for the clarification. So, it looks like this has been solved in the tests-passed. Good to know.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [August 20, 2018, 6:29pm UTC](https://meta.discourse.org/t/parent-category-counter/94635/10 "2018-08-20T18:29:02Z")

</div>

Maybe you can contact [Communiteq](https://www.communiteq.com) (formerly DiscourseHosting) and ask them to move you to the tests-passed channel?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [August 21, 2018, 1:19am UTC](https://meta.discourse.org/t/parent-category-counter/94635/11 "2018-08-21T01:19:20Z")

</div>


