News Articles
// Register Custom Post Type
function news_articles() {
$labels = array(
'name' => 'News Articles',
'singular_name' => 'News Article',
'menu_name' => 'News Article',
'parent_item_colon' => 'Parent Article:',
'all_items' => 'All Articles',
'view_item' => 'View Article',
'add_new_item' => 'Add New Article',
'add_new' => 'Add New',
'edit_item' => 'Edit Article',
'update_item' => 'Update Article',
'search_items' => 'Search Article',
'not_found' => 'Not found',
'not_found_in_trash' => 'Not found in Trash',
);
$rewrite = array(
'slug' => 'news',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => 'article',
'description' => 'Article Description',
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'trackbacks', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 20,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'post',
);
register_post_type( 'article', $args );
}
// Hook into the 'init' action
add_action( 'init', 'news_articles', 0 );