[wp-hackers] Why Can't Pages have Categories?

Michael D Adams mikea at turbonet.com
Fri Jul 21 18:37:28 GMT 2006


On Jul 21, 2006, at 1:38 AM, Mark Jaquith wrote:
> On Jul 21, 2006, at 3:44 AM, Computer Guru wrote:
>> How come posts can have categories, but not pages?
>
> What would be displayed if you viewed that category?  How do you  
> fit a page into a chronological listing of post?  And if you can't,  
> what is the point of categorization?

A context aware wp_list_pages() might answer your first question as  
Computer Guru mentions elsewhere in this thread.  As to your second:  
you don't, but that has nothing to do with your third.

Consider the same situation with links now instead of pages.

Links have categories.  Links and post even *share* categories.
Currently, all links are displayed in WordPress' category view (this  
can be customized at the theme level).
Links do not fit into chronological listings of posts.
The point of categorization is to group similar links.

Sounds fine.  I think Page Categories make as much sense.  The  
annoying thing is figuring out how to deal with objects that have  
both hierarchy and categories.

+1 to Computer Guru's idea:
Add Categories to Pages
wp_list_pages() displays in the same way it does now (i.e. it does  
not display by category)
wp_list_pages() takes a new optional parameter: in_category=#ID

The tricky Part:
If we ask for a hierarchical listing and a child is in the requested  
category but the parent is not.  Do we
A: not display that whole section of the hierarchy (i.e. the child  
does not get displayed)
OR
B: display that whole section of the hierarchy (i.e. the parent gets  
displayed)
OR
C: Don't display the parent, do display the child and its children  
(i.e. 'move the child up' in the hierarchy)
?

Keeping in mind that in a flat, non-hierarchical listing, this issue  
does not come up except as a potential consistency problem between  
flat and hierarchical displays.

Michael


More information about the wp-hackers mailing list