Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#2738 closed defect (bug) (fixed)

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

Reported by: macsek's profile MacSEK Owned by: ryan's profile ryan
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.1
Component: General Keywords: has-patch
Focuses: 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 (1)

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

Download all attachments as: .zip

Change History (4)

@andy
18 years ago

#1 @andy
18 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
18 years ago

  • Owner changed from anonymous to ryan

#3 @ryan
18 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.