Make WordPress Core

Opened 15 years ago

Closed 14 years ago

#2738 closed defect (bug) (fixed)

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

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


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 (1)

pad-counts.diff (4.7 KB) - added by andy 14 years ago.

Download all attachments as: .zip

Change History (4)

14 years ago

#1 @andy
14 years ago

  • Keywords has-patch added; Sidebar counting posts category removed
  • Milestone set to 2.1
  • Version changed from 2.0.2 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.

#2 @ryan
14 years ago

  • Owner changed from anonymous to ryan

#3 @ryan
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.