Ticket #2738 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Counting of post within a category dos not work correctly (unpublished posts are counted)

Reported by: MacSEK Assigned to: ryan
Priority: normal Milestone: 2.1
Component: General Version: 2.1
Severity: normal Keywords: has-patch
Cc:

Description

Within the Sidebar the categories are counting thier posts. If there are posts wich will be published in future, they are counted allready. You can see this bug on my weblog at http://www.dankefuernichts.com. The category video contains 4 posts. Two of them are allready Published. One will be released on monday next week, the fourth one one week later. Only two post are allready published. So the count should show 2, not 4.

Attachments

pad-counts.diff (4.7 kB) - added by andy on 12/13/06 19:33:40.

Change History

12/13/06 19:33:40 changed by andy

  • attachment pad-counts.diff added.

12/13/06 19:38:58 changed by andy

  • keywords changed from Sidebar counting posts category to has-patch.
  • version changed from 2.0.2 to 2.1.
  • milestone set to 2.1.

pad-counts.diff provides another method of counting categorized posts and links. This method pads parent category counts with the published posts/visible links of its children without counting any item twice. It is mainly useful for wp_list_categories as used in the default template, which is here fixed to eliminate the deprecated argument name.

The result of this type of counting is that when you click on a category archive link, the number next to that link represents the number of items in that archive. This has no effect on non-hierarchical category listings.

I tested this with future posting and all is well, both in the db and on the blog.

01/07/07 08:53:35 changed by ryan

  • owner changed from anonymous to ryan.

01/09/07 08:45:08 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [4707]) Hierarchical category count fixes from andy. fixes #2738