%PDF- %PDF-
Direktori : /var/www/cwg/wp-content/themes/cwg/inc/ |
Current File : //var/www/cwg/wp-content/themes/cwg/inc/custom-posts.php |
<?php /** * register custom posts here */ function book_type_taxonomy() { register_taxonomy( 'books-category', 'product', array( 'hierarchical' => true, 'label' => 'Book Type', //Display name 'query_var' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'booktype', 'with_front' => true) ) ); } add_action( 'init', 'book_type_taxonomy'); function publisher_taxonomy() { register_taxonomy( 'publisher', 'product', array( 'hierarchical' => true, 'label' => 'Publisher', //Display name 'query_var' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'publisher', 'with_front' => true) ) ); } add_action( 'init', 'publisher_taxonomy'); function jewellery_type_taxonomy() { register_taxonomy( 'jewellery-category', 'product', array( 'hierarchical' => true, 'label' => 'Jewellery Type', //Display name 'query_var' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'jewellerytype', 'with_front' => true) ) ); } add_action( 'init', 'jewellery_type_taxonomy'); function object_type_taxonomy() { register_taxonomy( 'objects-category', 'product', array( 'hierarchical' => true, 'label' => 'Object Type', //Display name 'query_var' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'objecttype', 'with_front' => true) ) ); } add_action( 'init', 'object_type_taxonomy'); function works_taxonomy() { register_taxonomy( 'work-category', 'works', array( 'hierarchical' => true, 'label' => 'Category', //Display name 'query_var' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'works', 'with_front' => true) ) ); } add_action( 'init', 'works_taxonomy'); function articles_taxonomy() { register_taxonomy( 'articles-category', 'articles', array( 'hierarchical' => true, 'label' => 'Category', //Display name 'query_var' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'articles', 'with_front' => true) ) ); } add_action( 'init', 'articles_taxonomy'); function pressarticles_taxonomy() { register_taxonomy( 'pressarticles-category', 'pressarticles', array( 'hierarchical' => true, 'label' => 'Category', //Display name 'query_var' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'pressarticles', 'with_front' => true) ) ); } add_action( 'init', 'pressarticles_taxonomy'); function videos_taxonomy() { register_taxonomy( 'videos-category', 'videos', array( 'hierarchical' => true, 'label' => 'Category', //Display name 'query_var' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'videos', 'with_front' => true) ) ); } add_action( 'init', 'videos_taxonomy'); function press_year_taxonomy() { register_taxonomy( 'press-year', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). 'pressarticles', //post type name array( 'hierarchical' => true, 'label' => 'Year', //Display name 'query_var' => true, 'rewrite' => array('slug' => 'pressarticles', 'with_front' => true) ) ); } add_action( 'init', 'press_year_taxonomy'); function press_publication_taxonomy() { register_taxonomy( 'press-publication', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). 'pressarticles', //post type name array( 'hierarchical' => true, 'label' => 'Publication', //Display name 'query_var' => true, 'rewrite' => array('slug' => 'pressarticles', 'with_front' => true) ) ); } add_action( 'init', 'press_publication_taxonomy'); /* * Creating a function to create our CPT */ function artist_custom_post_type() { // Set UI labels for Custom Post Type $labels = array( 'name' => _x( 'Artists', 'Post Type General Name', 'cwg' ), 'singular_name' => _x( 'Artist', 'Post Type Singular Name', 'cwg' ), 'menu_name' => __( 'Artists', 'cwg' ), 'parent_item_colon' => __( 'Parent Artist', 'cwg' ), 'all_items' => __( 'All Artists', 'cwg' ), 'view_item' => __( 'View Artist', 'cwg' ), 'add_new_item' => __( 'Add New Artist', 'cwg' ), 'add_new' => __( 'Add New', 'cwg' ), 'edit_item' => __( 'Edit Artist', 'cwg' ), 'update_item' => __( 'Update Artist', 'cwg' ), 'search_items' => __( 'Search Artist', 'cwg' ), 'not_found' => __( 'Not Found', 'cwg' ), 'not_found_in_trash' => __( 'Not found in Trash', 'cwg' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'artists', 'cwg' ), 'description' => __( 'CWG Artists', 'cwg' ), 'labels' => $labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), // You can associate this CPT with a taxonomy or custom taxonomy. 'taxonomies' => array( 'artist-type', 'artist-work-type' ), /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ '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, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', 'rewrite' => array('slug' => 'artists','with_front' => FALSE), 'public' => true, 'has_archive' => 'artist' ); if ( function_exists( 'acf_add_options_sub_page' ) ){ acf_add_options_sub_page(array( 'title' => 'Artist Settings', 'parent' => 'edit.php?post_type=artist', 'capability' => 'manage_options' )); } // Registering your Custom Post Type register_post_type( 'artists', $args ); } add_action( 'init', 'artist_custom_post_type', 0 ); function artist_type_taxonomy() { register_taxonomy( 'artist-type', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). 'artists', //post type name array( 'hierarchical' => true, 'label' => 'Artist Type', //Display name 'query_var' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'artist', 'with_front' => true) ) ); } add_action( 'init', 'artist_type_taxonomy'); function artist_work_type_taxonomy() { register_taxonomy( 'artist-work-type', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). 'artists', //post type name array( 'hierarchical' => true, 'label' => 'Artist Work Type', //Display name 'query_var' => true, 'rewrite' => array('slug' => 'artist', 'with_front' => true) ) ); } add_action( 'init', 'artist_work_type_taxonomy'); function fairs_custom_post_type() { // Set UI labels for Custom Post Type $labels = array( 'name' => _x( 'Fairs', 'Post Type General Name', 'cwg' ), 'singular_name' => _x( 'Fair', 'Post Type Singular Name', 'cwg' ), 'menu_name' => __( 'Fairs', 'cwg' ), 'parent_item_colon' => __( 'Parent Fair', 'cwg' ), 'all_items' => __( 'All Fairs', 'cwg' ), 'view_item' => __( 'View Fair', 'cwg' ), 'add_new_item' => __( 'Add New Fair', 'cwg' ), 'add_new' => __( 'Add New', 'cwg' ), 'edit_item' => __( 'Edit Fair', 'cwg' ), 'update_item' => __( 'Update Fair', 'cwg' ), 'search_items' => __( 'Search Fairs', 'cwg' ), 'not_found' => __( 'Not Found', 'cwg' ), 'not_found_in_trash' => __( 'Not found in Trash', 'cwg' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'fairs', 'cwg' ), 'description' => __( 'CWG Fairs', 'cwg' ), 'labels' => $labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), // You can associate this CPT with a taxonomy or custom taxonomy. 'taxonomies' => array( 'fair-location', 'fair-year' ), /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ 'hierarchical' => true, '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, 'rewrite' => array('has_archive' => true, 'slug' => 'fairs','with_front' => FALSE), 'public' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', ); // Registering your Custom Post Type register_post_type( 'fairs', $args ); } function fairs_taxonomy() { register_taxonomy( 'fair-location', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). 'fairs', //post type name array( 'hierarchical' => true, 'label' => 'Locations', //Display name 'query_var' => true, 'rewrite' => array('slug' => 'fairs', 'with_front' => true) ) ); } add_action( 'init', 'fairs_taxonomy'); function fairs_year_taxonomy() { register_taxonomy( 'fair-year', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). 'fairs', //post type name array( 'hierarchical' => true, 'label' => 'Year', //Display name 'query_var' => true, 'rewrite' => array('slug' => 'fairs', 'with_front' => true) ) ); } add_action( 'init', 'fairs_year_taxonomy'); /* Hook into the 'init' action so that the function * Containing our post type registration is not * unnecessarily executed. */ add_action( 'init', 'fairs_custom_post_type', 0 ); add_action( 'init', 'exhibitions_custom_post_type', 0 ); function exhibitions_custom_post_type() { // Set UI labels for Custom Post Type $labels = array( 'name' => _x( 'exhibitions', 'Post Type General Name', 'cwg' ), 'singular_name' => _x( 'Exhibition', 'Post Type Singular Name', 'cwg' ), 'menu_name' => __( 'Exhibitions', 'cwg' ), 'parent_item_colon' => __( 'Parent Exhibition', 'cwg' ), 'all_items' => __( 'All Exhibitions', 'cwg' ), 'view_item' => __( 'View Exhibition', 'cwg' ), 'add_new_item' => __( 'Add New Exhibition', 'cwg' ), 'add_new' => __( 'Add New', 'cwg' ), 'edit_item' => __( 'Edit Exhibition', 'cwg' ), 'update_item' => __( 'Update Exhibition', 'cwg' ), 'search_items' => __( 'Search Exhibitions', 'cwg' ), 'not_found' => __( 'Not Found', 'cwg' ), 'not_found_in_trash' => __( 'Not found in Trash', 'cwg' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'exhibitions', 'cwg' ), 'description' => __( 'CWG Exhibitions', 'cwg' ), 'labels' => $labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), // You can associate this CPT with a taxonomy or custom taxonomy. /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ 'hierarchical' => true, '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, 'rewrite' => array('has_archive' => true, 'slug' => 'exhibitions','with_front' => FALSE), 'public' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', 'taxonomies' => array( 'exhibitions-location', 'exhibitions-year' ), ); // Registering your Custom Post Type register_post_type( 'exhibitions', $args ); } add_action( 'init', 'viewingroom_custom_post_type', 0 ); function viewingroom_custom_post_type() { // Set UI labels for Custom Post Type $labels = array( 'name' => _x( 'Viewing Rooms', 'Post Type General Name', 'cwg' ), 'singular_name' => _x( 'Viewing Rooms', 'Post Type Singular Name', 'cwg' ), 'menu_name' => __( 'Viewing Rooms', 'cwg' ), 'parent_item_colon' => __( 'Parent Viewing Room', 'cwg' ), 'all_items' => __( 'All Viewing Rooms', 'cwg' ), 'view_item' => __( 'View Viewing Room', 'cwg' ), 'add_new_item' => __( 'Add New Viewing Room', 'cwg' ), 'add_new' => __( 'Add New', 'cwg' ), 'edit_item' => __( 'Edit Viewing Room', 'cwg' ), 'update_item' => __( 'Update Viewing Room', 'cwg' ), 'search_items' => __( 'Search Viewing Room', 'cwg' ), 'not_found' => __( 'Not Found', 'cwg' ), 'not_found_in_trash' => __( 'Not found in Trash', 'cwg' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'Viewing Rooms', 'cwg' ), 'description' => __( 'CWG Viewing Rooms', 'cwg' ), 'labels' => $labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), // You can associate this CPT with a taxonomy or custom taxonomy. 'taxonomies' => array( 'viewingroom-location' ), /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ 'hierarchical' => true, '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, 'rewrite' => array('has_archive' => true, 'slug' => 'viewing-room','with_front' => FALSE), 'public' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', ); // Registering your Custom Post Type register_post_type( 'viewingroom', $args ); } add_action( 'init', 'viewingroom_taxonomy'); function viewingroom_taxonomy() { register_taxonomy( 'viewingroom-location', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). 'viewingroom', //post type name array( 'hierarchical' => true, 'label' => 'Locations', //Display name 'query_var' => true, 'rewrite' => array('slug' => 'viewingroom', 'with_front' => true) ) ); } add_action( 'init', 'popups_custom_post_type', 0 ); function popups_custom_post_type() { // Set UI labels for Custom Post Type $labels = array( 'name' => _x( 'Pop-ups', 'Post Type General Name', 'cwg' ), 'singular_name' => _x( 'Pop-up', 'Post Type Singular Name', 'cwg' ), 'menu_name' => __( 'Pop-ups', 'cwg' ), 'parent_item_colon' => __( 'Parent Pop-up', 'cwg' ), 'all_items' => __( 'All Pop-ups', 'cwg' ), 'view_item' => __( 'View Pop-up', 'cwg' ), 'add_new_item' => __( 'Add New Pop-up', 'cwg' ), 'add_new' => __( 'Add New', 'cwg' ), 'edit_item' => __( 'Edit Pop-up', 'cwg' ), 'update_item' => __( 'Update Pop-up', 'cwg' ), 'search_items' => __( 'Search Pop-ups', 'cwg' ), 'not_found' => __( 'Not Found', 'cwg' ), 'not_found_in_trash' => __( 'Not found in Trash', 'cwg' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'popups', 'cwg' ), 'description' => __( 'CWG popups', 'cwg' ), 'labels' => $labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), // You can associate this CPT with a taxonomy or custom taxonomy. 'taxonomies' => array( 'popups-location', 'popups-year' ), /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ 'hierarchical' => true, '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, 'rewrite' => array('has_archive' => true, 'slug' => 'popups','with_front' => FALSE), 'public' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', ); // Registering your Custom Post Type register_post_type( 'popups', $args ); } add_action( 'init', 'popups_taxonomy'); function popups_taxonomy() { register_taxonomy( 'popups-location', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). 'popups', //post type name array( 'hierarchical' => true, 'label' => 'Locations', //Display name 'query_var' => true, 'rewrite' => array('slug' => 'popups', 'with_front' => true) ) ); } add_action( 'init', 'popups_year_taxonomy', 0); function popups_year_taxonomy() { register_taxonomy( 'popups-year', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). 'popups', //post type name array( 'hierarchical' => true, 'label' => 'Year', //Display name 'query_var' => true, 'rewrite' => array('slug' => 'popups', 'with_front' => true) ) ); } function exhibitions_taxonomy() { register_taxonomy( 'exhibitions-location', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). 'exhibitions', //post type name array( 'hierarchical' => true, 'label' => 'Locations', //Display name 'query_var' => true, 'rewrite' => array('slug' => 'exhibitions', 'with_front' => true) ) ); } add_action( 'init', 'exhibitions_taxonomy'); function exhibitions_year_taxonomy() { register_taxonomy( 'exhibitions-year', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). 'exhibitions', //post type name array( 'hierarchical' => true, 'label' => 'Year', //Display name 'query_var' => true, 'rewrite' => array('slug' => 'exhibitions', 'with_front' => true) ) ); } add_action( 'init', 'exhibitions_year_taxonomy', 0); function press_custom_post_type() { // Set UI labels for Custom Post Type $labels = array( 'name' => _x( 'press', 'Post Type General Name', 'cwg' ), 'singular_name' => _x( 'press', 'Post Type Singular Name', 'cwg' ), 'menu_name' => __( 'Press', 'cwg' ), 'parent_item_colon' => __( 'Parent Press', 'cwg' ), 'all_items' => __( 'All Press', 'cwg' ), 'view_item' => __( 'View Press', 'cwg' ), 'add_new_item' => __( 'Add New Press', 'cwg' ), 'add_new' => __( 'Add New', 'cwg' ), 'edit_item' => __( 'Edit Press', 'cwg' ), 'update_item' => __( 'Update Press', 'cwg' ), 'search_items' => __( 'Search ', 'cwg' ), 'not_found' => __( 'Not Found', 'cwg' ), 'not_found_in_trash' => __( 'Not found in Trash', 'cwg' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'press', 'cwg' ), 'description' => __( 'CWG Press', 'cwg' ), 'labels' => $labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), // You can associate this CPT with a taxonomy or custom taxonomy. 'taxonomies' => array( ''), /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ 'hierarchical' => true, '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, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', 'rewrite' => array( 'slug' => 'press', 'with_front' => false ), 'public' => true, 'has_archive' => 'press_article' ); if ( function_exists( 'acf_add_options_sub_page' ) ){ acf_add_options_sub_page(array( 'title' => 'Press Settings', 'parent' => 'edit.php?post_type=press', 'capability' => 'manage_options' )); } // Registering your Custom Post Type register_post_type( 'press', $args ); } /* Hook into the 'init' action so that the function * Containing our post type registration is not * unnecessarily executed. */ //add_action( 'init', 'press_custom_post_type', 0 ); function articles_custom_post_type() { // Set UI labels for Custom Post Type $labels = array( 'name' => _x( 'articles', 'Post Type General Name', 'cwg' ), 'singular_name' => _x( 'Article', 'Post Type Singular Name', 'cwg' ), 'menu_name' => __( 'Articles', 'cwg' ), 'parent_item_colon' => __( 'Parent Article', 'cwg' ), 'all_items' => __( 'All Articles', 'cwg' ), 'view_item' => __( 'View Article', 'cwg' ), 'add_new_item' => __( 'Add New Article', 'cwg' ), 'add_new' => __( 'Add New', 'cwg' ), 'edit_item' => __( 'Edit Article', 'cwg' ), 'update_item' => __( 'Update Article', 'cwg' ), 'search_items' => __( 'Search ', 'cwg' ), 'not_found' => __( 'Not Found', 'cwg' ), 'not_found_in_trash' => __( 'Not found in Trash', 'cwg' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'articles', 'cwg' ), 'description' => __( 'CWG Articles', 'cwg' ), 'labels' => $labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), // You can associate this CPT with a taxonomy or custom taxonomy. 'taxonomies' => array( 'articles-category'), /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ 'hierarchical' => true, '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, // 'rewrite' => array('slug' => 'articles','with_front' => FALSE), 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', 'rewrite' => array( //'slug' => 'event', 'slug' => 'articles/%articles-category%', 'with_front' => false ), 'public' => true, 'has_archive' => 'articles' ); if ( function_exists( 'acf_add_options_sub_page' ) ){ acf_add_options_sub_page(array( 'title' => 'Article Settings', 'parent' => 'edit.php?post_type=articles', 'capability' => 'manage_options' )); } // Registering your Custom Post Type register_post_type( 'articles', $args ); } /* Hook into the 'init' action so that the function * Containing our post type registration is not * unnecessarily executed. */ //add_action( 'init', 'articles_custom_post_type', 0 ); //add_action( 'init', 'press_custom_post_type', 0 ); function pressarticles_custom_post_type() { // Set UI labels for Custom Post Type $labels = array( 'name' => _x( 'Press Articles', 'Post Type General Name', 'cwg' ), 'singular_name' => _x( 'Press Article', 'Post Type Singular Name', 'cwg' ), 'menu_name' => __( 'Press Articles', 'cwg' ), 'parent_item_colon' => __( 'Parent Press Article', 'cwg' ), 'all_items' => __( 'All Press Articles', 'cwg' ), 'view_item' => __( 'View Press Article', 'cwg' ), 'add_new_item' => __( 'Add New Press Article', 'cwg' ), 'add_new' => __( 'Add New', 'cwg' ), 'edit_item' => __( 'Edit Press Article', 'cwg' ), 'update_item' => __( 'Update Press Article', 'cwg' ), 'search_items' => __( 'Search ', 'cwg' ), 'not_found' => __( 'Not Found', 'cwg' ), 'not_found_in_trash' => __( 'Not found in Trash', 'cwg' ), ); // Set other options for Custom Post Type $args = array( 'label' => __( 'Press Articles', 'cwg' ), 'description' => __( 'CWG Press Articles', 'cwg' ), 'labels' => $labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), // You can associate this CPT with a taxonomy or custom taxonomy. //'taxonomies' => array( 'pressarticles-category'), 'taxonomies' => array( 'press-year', 'press-publication', 'pressarticles-category'), /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ 'hierarchical' => true, '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, // 'rewrite' => array('slug' => 'articles','with_front' => FALSE), 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', 'rewrite' => array( //'slug' => 'event', 'slug' => 'press-articles', 'with_front' => false ), 'public' => true, 'has_archive' => 'pressarticles' ); if ( function_exists( 'acf_add_options_sub_page' ) ){ acf_add_options_sub_page(array( 'title' => 'Press Article Settings', 'parent' => 'edit.php?post_type=pressarticles', 'capability' => 'manage_options' )); } // Registering your Custom Post Type register_post_type( 'pressarticles', $args ); } /* Hook into the 'init' action so that the function * Containing our post type registration is not * unnecessarily executed. */ add_action( 'init', 'pressarticles_custom_post_type', 0 ); add_filter('post_type_link', 'articles_permalink_structure', 10, 4); function articles_permalink_structure($post_link, $post, $leavename, $sample) { if ( false !== strpos( $post_link, '%articles-category%' ) ) { $articles_type_term = get_the_terms( $post->ID, 'articles-category' ); $post_link = str_replace( '%articles-category%', array_pop( $articles_type_term )->slug, $post_link ); } return $post_link; } function works_custom_post_type() { $labels = array( 'name' => _x( 'Works', 'Post Type General Name', 'cwg' ), 'singular_name' => _x( 'Work', 'Post Type Singular Name', 'cwg' ), 'menu_name' => __( 'Works', 'cwg' ), 'parent_item_colon' => __( 'Parent Work', 'cwg' ), 'all_items' => __( 'All Works', 'cwg' ), 'view_item' => __( 'View Work', 'cwg' ), 'add_new_item' => __( 'Add New Work', 'cwg' ), 'add_new' => __( 'Add New', 'cwg' ), 'edit_item' => __( 'Edit Work', 'cwg' ), 'update_item' => __( 'Update Work', 'cwg' ), 'search_items' => __( 'Search Works', 'cwg' ), 'not_found' => __( 'Not Found', 'cwg' ), 'not_found_in_trash' => __( 'Not found in Trash', 'cwg' ), ); $args = array( 'label' => __( 'works', 'cwg' ), 'description' => __( 'CWG Works', 'cwg' ), 'labels' => $labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', 'tags' ), // You can associate this CPT with a taxonomy or custom taxonomy. 'taxonomies' => array( 'work-category', 'post_tag' ), /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ 'hierarchical' => true, '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, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', 'rewrite' => array( 'has_archive' => true, 'slug' => 'works', 'with_front' => false ), 'public' => true, 'has_archive' => 'works', 'register_meta_box_cb' => 'works_meta_box', // Register a meta box ); // Registering your Custom Post Type register_post_type( 'works', $args ); } //add_action( 'init', 'works_custom_post_type', 0 ); function news_custom_post_type() { $labels = array( 'name' => _x( 'News', 'Post Type General Name', 'cwg' ), 'singular_name' => _x( 'News', 'Post Type Singular Name', 'cwg' ), 'menu_name' => __( 'News', 'cwg' ), 'parent_item_colon' => __( 'Parent News', 'cwg' ), 'all_items' => __( 'All News', 'cwg' ), 'view_item' => __( 'View News', 'cwg' ), 'add_new_item' => __( 'Add New News', 'cwg' ), 'add_new' => __( 'Add New', 'cwg' ), 'edit_item' => __( 'Edit News', 'cwg' ), 'update_item' => __( 'Update News', 'cwg' ), 'search_items' => __( 'Search ', 'cwg' ), 'not_found' => __( 'Not Found', 'cwg' ), 'not_found_in_trash' => __( 'Not found in Trash', 'cwg' ), ); $args = array( 'label' => __( 'News', 'cwg' ), 'description' => __( 'CWG News', 'cwg' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), 'hierarchical' => true, '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, // 'rewrite' => array('slug' => 'articles','with_front' => FALSE), 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', 'rewrite' => array( 'slug' => 'news', 'with_front' => false ), 'public' => true, 'has_archive' => 'news' ); if ( function_exists( 'acf_add_options_sub_page' ) ){ acf_add_options_sub_page(array( 'title' => 'News Settings', 'parent' => 'edit.php?post_type=news', 'capability' => 'manage_options' )); } // Registering your Custom Post Type register_post_type( 'news', $args ); } add_action( 'init', 'news_custom_post_type', 0 ); // Register Custom Post Type Career function create_career_cpt() { $labels = array( 'name' => _x( 'Careers', 'Post Type General Name', 'career' ), 'singular_name' => _x( 'Career', 'Post Type Singular Name', 'career' ), 'menu_name' => _x( 'Careers', 'Admin Menu text', 'career' ), 'name_admin_bar' => _x( 'Career', 'Add New on Toolbar', 'career' ), 'archives' => __( 'Career Archives', 'career' ), 'attributes' => __( 'Career Attributes', 'career' ), 'parent_item_colon' => __( 'Parent Career:', 'career' ), 'all_items' => __( 'All Careers', 'career' ), 'add_new_item' => __( 'Add New Career', 'career' ), 'add_new' => __( 'Add New', 'career' ), 'new_item' => __( 'New Career', 'career' ), 'edit_item' => __( 'Edit Career', 'career' ), 'update_item' => __( 'Update Career', 'career' ), 'view_item' => __( 'View Career', 'career' ), 'view_items' => __( 'View Careers', 'career' ), 'search_items' => __( 'Search Career', 'career' ), 'not_found' => __( 'Not found', 'career' ), 'not_found_in_trash' => __( 'Not found in Trash', 'career' ), 'featured_image' => __( 'Featured Image', 'career' ), 'set_featured_image' => __( 'Set featured image', 'career' ), 'remove_featured_image' => __( 'Remove featured image', 'career' ), 'use_featured_image' => __( 'Use as featured image', 'career' ), 'insert_into_item' => __( 'Insert into Career', 'career' ), 'uploaded_to_this_item' => __( 'Uploaded to this Career', 'career' ), 'items_list' => __( 'Careers list', 'career' ), 'items_list_navigation' => __( 'Careers list navigation', 'career' ), 'filter_items_list' => __( 'Filter Careers list', 'career' ), ); $args = array( 'label' => __( 'Career', 'career' ), 'description' => __( '', 'career' ), 'labels' => $labels, 'menu_icon' => 'dashicons-businessman', 'supports' => array('title', 'editor'), 'taxonomies' => array(), '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' => false, 'hierarchical' => false, 'exclude_from_search' => false, 'show_in_rest' => true, 'publicly_queryable' => true, 'capability_type' => 'post', ); register_post_type( 'career', $args ); } add_action( 'init', 'create_career_cpt', 0 );