Hi, i’ve read there will be a new feature to have specific templates for custom post types; but I wasn’t able to find good explanations.
in my code, i have
register_post_type( 'yclad' ... 'rewrite' => Array( 'slug' => _x('classified-ads','slug','yclads'), 'with_front' => false ), 'has_archive' => true
So If I well understood, with this;
- /classified-ads/ will be the rewritten url for this post type.
- archive-yclad.php should be the template loaded when accessing /wordpress/?post_type=yclad
Is that correct ?
/classified-ads/my-post works; but
/classified-ads/ goes to 404.
I did try to refresh the permalinks, and also to put
flush_rewrite_rules( false );
It does not work.
Also, is there a conditionnal tag to check if we are browsing a particular post type ?
I would like a function to detect if we are on /wordpress/?post_type=yclad
Is there something like is_archive(‘yclad’) ?
- The topic ‘WP3.1 : custom post types templates’ is closed to new replies.