[wp-trac] [WordPress Trac] #13818: There should be index pages for custom post types

WordPress Trac wp-trac at lists.automattic.com
Fri Oct 15 06:12:25 UTC 2010


#13818: There should be index pages for custom post types
----------------------------+-----------------------------------------------
 Reporter:  frankieroberto  |       Owner:  nacin   
     Type:  task (blessed)  |      Status:  accepted
 Priority:  normal          |   Milestone:  3.1     
Component:  Template        |     Version:  3.0     
 Severity:  normal          |    Keywords:          
----------------------------+-----------------------------------------------

Comment(by greenshady):

 > Way to differentiate between pre-3.1 archive.php usage, and expanded
 archive.php usage -- that is, is_post_type_archive() (how would we handle
 post_type=post?). Debating whether we want a new query flag and make the
 difference more pronounced, or if it's best to be as agnostic as possible.
 is_post_type_archive() sounds like all we need is ! is_archive('post'),
 maybe we leave it at that?

 `!is_archive( 'post' )` can probably work for the most part.  However, it
 doesn't mean one would be viewing a post type archive page.  For example,
 that conditional check would be true if viewing a taxonomy archive for a
 non-post post type.

  * `is_archive( 'post' )` - True for any archive page displaying posts of
 the "post" post type.
  * `!is_archive( 'post' )` - True for any archive page displaying posts
 not of the "post" post type.

 I like being able to use `is_archive()` like this because it'll let me
 know what post types are in use on any archive.  But, it doesn't work
 specifically for the post type archive/index page.

 > post_type_archive_title() sounds like it would just wrap
 post_obj->labels->name. So we just need to figure out what the best name
 would be for the function. And use it in wp_title().

 That's the label I'd use.  Similar functions are `single_cat_title()`,
 `single_term_title()`, and `single_month_title()`.  I'm not sure if the
 `single_` prefix would be good here.

 > Body classes.

 `archive-post_type` would work for the body class.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13818#comment:52>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list