gG Farms Post Type
// Register Custom Post Type
function farms_post_type() {
$labels = array(
'name' => _x( 'Farms', 'Post Type General Name', 'gG_' ),
'singular_name' => _x( 'Farm', 'Post Type Singular Name', 'gG_' ),
'menu_name' => __( 'Farms', 'gG_' ),
'name_admin_bar' => __( 'Farm', 'gG_' ),
'archives' => __( 'Farm Archives', 'gG_' ),
'attributes' => __( 'Farm Attributes', 'gG_' ),
'parent_item_colon' => __( 'Parent Farm:', 'gG_' ),
'all_items' => __( 'All Farms', 'gG_' ),
'add_new_item' => __( 'Add New Farm', 'gG_' ),
'add_new' => __( 'New Farm', 'gG_' ),
'new_item' => __( 'New Farm', 'gG_' ),
'edit_item' => __( 'Edit Farm', 'gG_' ),
'update_item' => __( 'Update Farm', 'gG_' ),
'view_item' => __( 'View Farm', 'gG_' ),
'view_items' => __( 'View Farms', 'gG_' ),
'search_items' => __( 'Search Farms', 'gG_' ),
'not_found' => __( 'No Farms Found', 'gG_' ),
'not_found_in_trash' => __( 'No Farms Found in Trash', 'gG_' ),
'featured_image' => __( 'Featured Image', 'gG_' ),
'set_featured_image' => __( 'Set featured image', 'gG_' ),
'remove_featured_image' => __( 'Remove featured image', 'gG_' ),
'use_featured_image' => __( 'Use as featured image', 'gG_' ),
'insert_into_item' => __( 'Insert into farm', 'gG_' ),
'uploaded_to_this_item' => __( 'Uploaded to this farm', 'gG_' ),
'items_list' => __( 'Farms List', 'gG_' ),
'items_list_navigation' => __( 'Farms List Navigation', 'gG_' ),
'filter_items_list' => __( 'Filter Farms List', 'gG_' ),
);
$args = array(
'label' => __( 'Farm', 'gG_' ),
'description' => __( 'Farm profile pages.', 'gG_' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', ),
'taxonomies' => array( 'farm-types' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'farm', $args );
}
add_action( 'init', 'farms_post_type', 0 );