WordPress.org

Ready to get started?Download WordPress

Forums

Including Custom Posts in Archives (2 posts)

  1. alanchrishughes
    Member
    Posted 3 years ago #

    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,
    )
    );
    }
  2. alanchrishughes
    Member
    Posted 3 years ago #

    Anybody? Any links to articles I may have some how missed?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.