<?php
register_post_type('Article', array(
'labels' => array(
'name' => 'Articles',
'singular_name' => 'Article',
'add_new' => __( 'Add New' ),
'add_new_item' => __( 'Add new Article' ),
'view_item' => 'View Article',
'edit_item' => 'Edit Article',
'new_item' => __('New Article'),
'view_item' => __('View Article'),
'search_items' => __('Search Article'),
'not_found' => __('No Article found'),
'not_found_in_trash' => __('No Article found in Trash'),
),
'public' => true,
'exclude_from_search' => false,
'show_ui' => true,
'capability_type' => 'post',
'hierarchical' => false,
'_edit_link' => 'post.php?post=%d',
'rewrite' => array(
"slug" => "article",
"with_front" => false,
),
'query_var' => true,
'supports' => array('title', 'editor', 'page-attributes'),
'menu_position' => 101
));
//Categories
register_taxonomy(
'categories',
array('article'),
array(
'hierarchical' => true,
'labels' => array(
'name' => _x( 'Categories', 'taxonomy general name' ),
'singular_name' => _x( 'Category', 'taxonomy singular name' ),
'search_items' => __( 'Search Category' ),
'all_items' => __( 'All Categories' ),
'parent_item' => __( 'Parent Category' ),
'parent_item_colon' => __( 'Parent Category:' ),
'edit_item' => __( 'Edit Category' ),
'update_item' => __( 'Update Category' ),
'add_new_item' => __( 'Add New Category' ),
'new_item_name' => __( 'New Category Name' ),
'menu_name' => __( 'Category' ),
),
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
"slug" => "category",
"with_front" => false,
),
));
//Countries
register_taxonomy(
'country',
array('article'),
array(
'hierarchical' => true,
'labels' => array(
'name' => _x( 'Countries', 'taxonomy general name' ),
'singular_name' => _x( 'Country', 'taxonomy singular name' ),
'search_items' => __( 'Search Countries' ),
'all_items' => __( 'All Countries' ),
'parent_item' => __( 'Parent Country' ),
'parent_item_colon' => __( 'Parent Country:' ),
'edit_item' => __( 'Edit Country' ),
'update_item' => __( 'Update Country' ),
'add_new_item' => __( 'Add New Country' ),
'new_item_name' => __( 'New Country Name' ),
'menu_name' => __( 'Countries' ),
),
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
"slug" => "country",
"with_front" => false,
),
));
//Regions
register_taxonomy(
'region',
array('article'),
array(
'hierarchical' => true,
'labels' => array(
'name' => _x( 'Regions', 'taxonomy general name' ),
'singular_name' => _x( 'Region', 'taxonomy singular name' ),
'search_items' => __( 'Search Regions' ),
'all_items' => __( 'All Regions' ),
'parent_item' => __( 'Parent Region' ),
'parent_item_colon' => __( 'Parent Region:' ),
'edit_item' => __( 'Edit Region' ),
'update_item' => __( 'Update Region' ),
'add_new_item' => __( 'Add New Region' ),
'new_item_name' => __( 'New Region Name' ),
'menu_name' => __( 'Regions' ),
),
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
"slug" => "region",
"with_front" => false,
),
));
?>
register_post_type('Article', array(
'labels' => array(
'name' => 'Articles',
'singular_name' => 'Article',
'add_new' => __( 'Add New' ),
'add_new_item' => __( 'Add new Article' ),
'view_item' => 'View Article',
'edit_item' => 'Edit Article',
'new_item' => __('New Article'),
'view_item' => __('View Article'),
'search_items' => __('Search Article'),
'not_found' => __('No Article found'),
'not_found_in_trash' => __('No Article found in Trash'),
),
'public' => true,
'exclude_from_search' => false,
'show_ui' => true,
'capability_type' => 'post',
'hierarchical' => false,
'_edit_link' => 'post.php?post=%d',
'rewrite' => array(
"slug" => "article",
"with_front" => false,
),
'query_var' => true,
'supports' => array('title', 'editor', 'page-attributes'),
'menu_position' => 101
));
//Categories
register_taxonomy(
'categories',
array('article'),
array(
'hierarchical' => true,
'labels' => array(
'name' => _x( 'Categories', 'taxonomy general name' ),
'singular_name' => _x( 'Category', 'taxonomy singular name' ),
'search_items' => __( 'Search Category' ),
'all_items' => __( 'All Categories' ),
'parent_item' => __( 'Parent Category' ),
'parent_item_colon' => __( 'Parent Category:' ),
'edit_item' => __( 'Edit Category' ),
'update_item' => __( 'Update Category' ),
'add_new_item' => __( 'Add New Category' ),
'new_item_name' => __( 'New Category Name' ),
'menu_name' => __( 'Category' ),
),
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
"slug" => "category",
"with_front" => false,
),
));
//Countries
register_taxonomy(
'country',
array('article'),
array(
'hierarchical' => true,
'labels' => array(
'name' => _x( 'Countries', 'taxonomy general name' ),
'singular_name' => _x( 'Country', 'taxonomy singular name' ),
'search_items' => __( 'Search Countries' ),
'all_items' => __( 'All Countries' ),
'parent_item' => __( 'Parent Country' ),
'parent_item_colon' => __( 'Parent Country:' ),
'edit_item' => __( 'Edit Country' ),
'update_item' => __( 'Update Country' ),
'add_new_item' => __( 'Add New Country' ),
'new_item_name' => __( 'New Country Name' ),
'menu_name' => __( 'Countries' ),
),
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
"slug" => "country",
"with_front" => false,
),
));
//Regions
register_taxonomy(
'region',
array('article'),
array(
'hierarchical' => true,
'labels' => array(
'name' => _x( 'Regions', 'taxonomy general name' ),
'singular_name' => _x( 'Region', 'taxonomy singular name' ),
'search_items' => __( 'Search Regions' ),
'all_items' => __( 'All Regions' ),
'parent_item' => __( 'Parent Region' ),
'parent_item_colon' => __( 'Parent Region:' ),
'edit_item' => __( 'Edit Region' ),
'update_item' => __( 'Update Region' ),
'add_new_item' => __( 'Add New Region' ),
'new_item_name' => __( 'New Region Name' ),
'menu_name' => __( 'Regions' ),
),
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
"slug" => "region",
"with_front" => false,
),
));
?>