Including Custom Posts in Archives
-
I was all excited to create a handful of custom post types for my personal website, but then I realized none of my new posts were showing up in the monthly archives or the rss feed. This is the code I used to register the post type.
add_action( 'init', 'create_my_post_types' ); function create_my_post_types() { register_post_type( 'photography', array( 'labels' => array( 'name' => __( 'Photos' ), 'singular_name' => __( 'Artist' ), 'add_new' => __( 'Add Photo' ), 'add_new_item' => __( 'Add Photo' ), 'edit' => __( 'Edit Photo' ), 'edit_item' => __( 'Edit Photo' ), 'new_item' => __( 'New Photo' ), 'view' => __( 'View Photo' ), 'view_item' => __( 'View Photo' ), 'search_items' => __( 'Search Photos' ), 'not_found' => __( 'Nothing Found' ), 'not_found_in_trash' => __( 'None in Trash' ), 'parent' => __( 'Parent Photo' ), 'query_var' => true, ), 'rewrite' => array('slug' => 'photography', 'with_front' => false), 'supports' => array( 'title', 'editor', ), 'public' => true, 'show_ui' => true, 'menu_icon' => '', 'publicly_queryable' => true, 'exclude_from_search' => false, 'menu_position' => 4, ) ); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Including Custom Posts in Archives’ is closed to new replies.