Directory Custom Post Type
if ( ! function_exists('nwiop_directory') ) {
// Register Custom Post Type
function nwiop_directory() {
$labels = array(
'name' => _x( 'Listings', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Listing', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Directory', 'text_domain' ),
'parent_item_colon' => __( 'Parent', 'text_domain' ),
'all_items' => __( 'All', 'text_domain' ),
'view_item' => __( 'View', 'text_domain' ),
'add_new_item' => __( 'Add New', 'text_domain' ),
'add_new' => __( 'Add New', 'text_domain' ),
'edit_item' => __( 'Edit Item', 'text_domain' ),
'update_item' => __( 'Update', 'text_domain' ),
'search_items' => __( 'Search', 'text_domain' ),
'not_found' => __( 'Not found', 'text_domain' ),
'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),
);
$rewrite = array(
'slug' => 'directory',
'with_front' => false,
'pages' => true,
'feeds' => false,
);
$args = array(
'label' => __( 'nwiop_d', 'text_domain' ),
'description' => __( 'Directory Listings', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', ),
'taxonomies' => array( 'directory_type' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'post',
);
register_post_type( 'nwiop_d', $args );
}
// Hook into the 'init' action
add_action( 'init', 'nwiop_directory', 0 );
}