Forums › Forums › Search & Filter Pro › 'Display Count' misleading for parent items
- This topic has 7 replies, 3 voices, and was last updated 10 years ago by Anonymous.
-
Anonymous(Private) May 30, 2014 at 11:47 am #1018
The display count for a parent totals all counts for itself and any child. This is misleading to the viewer.
Example: Parent category has no items; child category A has 4 items; child category B has 3 items. Parent category shows (7) items. This is misleading because the viewer thinks they will see 7 results if they select the parent category. Instead they get ‘no results found’ and wonder why the system said there were (7).
Either the count should display actual-items-only in the parent (not the sum of children) or the system should return all items matching the total count shown for the parent.
Thanks for your consideration. It is great to see a professional plugin in this filter space since the others either are un-supported or difficult to use.
Ken Z
Ross Moderator(Private) May 30, 2014 at 12:22 pm #1019Hey Ken
The way all the taxonomy fields are displayed are using a hook in to WordPress’ own function –
http://codex.wordpress.org/Template_Tags/wp_list_categoriesSo the logic behind the count function is handled by WordPress and seems to be the recommended way that this works (WordPress is not always right though).
In my experience, for example when dealing with other real world data, is that posts that are of a child category, will also be added to the parent category.
For example with the WooCommerce sample data you have singles and albums (as a product post type), which both have the parent category of music (if your not familiar with the sample data its just a load of test products with categories and tags – see it in action).
All the singles have both checked
music
andsingles
as their category in the post edit screen. So the count would not be misleading and you could search in just the parent category or a child category easily.It depends on how you look at it I guess, if I saw a parent category with no no posts and then child categories with posts I would find that a bit confusing, I would assume a parent category is the sum of its parts (ie the children).
So for now, what you need to do is also add the posts to the parent category to make those number exactly accurate. I’ll have a think some more about this logic I do plan on more customisations but it won’t be something I’ll update soon.
Let me know if you have any suggestions/comments.
Thanks
Anonymous(Private) June 1, 2014 at 3:05 pm #1075I agree that a parent with no posts would be confusing as well (if the children have posts).
So …
Given we have to work within WP definitions, please consider returning the posts to match the total presented. That is, if the parent shows (7), then return (7) by returning each set of child posts.Having to select a category and its parent would be difficult to enforce for multiple authors. It is easier for them to select the best matching category than to also have to pick the parent as well. (They will not always do this). Also, this gets further complicated when they pick a grand-child, they would then have to pick a child AND a parent. (Not an intuitive thing to do for a post author).
Again, if you would consider returning the posts matching the total shown for a selected category, this would be the best.
Ken Z
Anonymous(Private) June 26, 2014 at 1:15 pm #1913Hi
I am having this same “issue”. I don’t put my posts into their respective parent categories either (and I’ve too many to do it now) because I think there’s no point in having the child category then, but that’s just me.I like Ken’s suggestion of showing everything in the child categories if a parent is selected, that’s the way other themes I have used handled it.
Either that or make the parents unclickable somehow.Great plugin by the way.
Philip.Ross Moderator(Private) June 29, 2014 at 12:46 pm #1955Thanks Philip this is on my to do list for sure, I’ve had a few other users mention this – the only reason I initially did it this was because WP does this with its own functions, I am realising now though that this is not the best way 🙂
Look out for the update next weekend.
Thanks
-
AuthorPosts