Press Releases
if ( ! function_exists('custom_post_type') ) {
// Register Custom Post Type
function custom_post_type() {
$labels = array(
'name' => _x( 'Press Releases', 'Post Type General Name', 'sencha' ),
'singular_name' => _x( 'Press Release', 'Post Type Singular Name', 'sencha' ),
'menu_name' => __( 'Press Releases', 'sencha' ),
'parent_item_colon' => __( 'Parent Item:', 'sencha' ),
'all_items' => __( 'All Press', 'sencha' ),
'view_item' => __( 'View Release', 'sencha' ),
'add_new_item' => __( 'Add New Press Release', 'sencha' ),
'add_new' => __( 'Add Press Release', 'sencha' ),
'edit_item' => __( 'Edit Press Release', 'sencha' ),
'update_item' => __( 'Update Press Release', 'sencha' ),
'search_items' => __( 'Search Press Releases', 'sencha' ),
'not_found' => __( 'Not found', 'sencha' ),
'not_found_in_trash' => __( 'Not found in Trash', 'sencha' ),
);
$rewrite = array(
'slug' => 'press',
'with_front' => false,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'press-releases', 'sencha' ),
'description' => __( 'Press & News', 'sencha' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'page-attributes', 'post-formats', ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-megaphone',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'query_var' => 'press',
'rewrite' => $rewrite,
'capability_type' => 'page',
);
register_post_type( 'press-releases', $args );
}
// Hook into the 'init' action
add_action( 'init', 'custom_post_type', 0 );
}