Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Uplift › Custom Post Type UI – Post type isnt available to 'View'
New Landing › How can we help? › Themeforest Theme Support › Uplift › Custom Post Type UI – Post type isnt available to 'View'
- This topic has 2 replies, 2 voices, and was last updated 8 years by Mohammad – SUPPORT.
Viewing 3 posts - 1 through 3 (of 3 total)
-
Posted in: Uplift
-
September 8, 2016 at 9:50 am #291040
After installing the Custom Post Type UI plugin and placing the code into the child theme functions.php.
The post type displays in the dashboard and its possible to create new etc. However you cannot ‘view’ the post type or get a url.
I checked and the public is set to true etc. If fact code is below
add_action( 'init', 'cptui_register_my_cpts' ); function cptui_register_my_cpts() { $labels = array( "name" => __( 'Events', '' ), "singular_name" => __( 'Event', '' ), "add_new_item" => __( 'Add New Event', '' ), ); $args = array( "label" => __( 'Events', '' ), "labels" => $labels, "description" => "", "public" => true, "publicly_queryable" => false, "show_ui" => true, "show_in_rest" => false, "rest_base" => "", "has_archive" => false, "show_in_menu" => true, "exclude_from_search" => false, "capability_type" => "post", "map_meta_cap" => true, "hierarchical" => true, "rewrite" => array( "slug" => "events", "with_front" => true ), "query_var" => true, "supports" => array( "title", "editor", "thumbnail", "excerpt", "custom-fields", "comments", "revisions", "author", "page-attributes" ), "taxonomies" => array( "category", "post_tag" ), ); register_post_type( "events", $args ); $labels = array( "name" => __( 'Podcasts', '' ), "singular_name" => __( 'Podcast', '' ), ); $args = array( "label" => __( 'Podcasts', '' ), "labels" => $labels, "description" => "", "public" => true, "publicly_queryable" => false, "show_ui" => true, "show_in_rest" => false, "rest_base" => "", "has_archive" => false, "show_in_menu" => true, "exclude_from_search" => false, "capability_type" => "post", "map_meta_cap" => true, "hierarchical" => true, "rewrite" => true, "query_var" => true, "supports" => array( "title", "editor", "excerpt", "trackbacks", "custom-fields", "comments", "revisions", "thumbnail", "author", "page-attributes" ), "taxonomies" => array( "category", "post_tag" ), ); register_post_type( "Podcast", $args ); $labels = array( "name" => __( 'Latest News', '' ), "singular_name" => __( 'News', '' ), "menu_name" => __( 'Latest News', '' ), "add_new" => __( 'Add News', '' ), "add_new_item" => __( 'Add Latest News', '' ), ); $args = array( "label" => __( 'Latest News', '' ), "labels" => $labels, "description" => "", "public" => true, "publicly_queryable" => false, "show_ui" => true, "show_in_rest" => false, "rest_base" => "", "has_archive" => true, "show_in_menu" => true, "exclude_from_search" => false, "capability_type" => "post", "map_meta_cap" => true, "hierarchical" => true, "rewrite" => true, "query_var" => true, "supports" => array( "title", "editor", "excerpt", "trackbacks", "custom-fields", "comments", "revisions", "thumbnail", "author", "page-attributes" ), "taxonomies" => array( "category", "post_tag" ), ); register_post_type( "latestnews", $args ); $labels = array( "name" => __( 'Artists', '' ), "singular_name" => __( 'Artist', '' ), "menu_name" => __( 'Artists', '' ), "add_new" => __( 'Add New', '' ), "add_new_item" => __( 'Add New Artist', '' ), "edit_item" => __( 'Edit Artist', '' ), "new_item" => __( 'New Artist', '' ), "search_items" => __( 'Search Artist', '' ), "not_found" => __( 'No Artists Found', '' ), ); $args = array( "label" => __( 'Artists', '' ), "labels" => $labels, "description" => "", "public" => true, "publicly_queryable" => false, "show_ui" => true, "show_in_rest" => false, "rest_base" => "", "has_archive" => true, "show_in_menu" => true, "exclude_from_search" => false, "capability_type" => "post", "map_meta_cap" => true, "hierarchical" => true, "rewrite" => array( "slug" => "artists", "with_front" => true ), "query_var" => true, "supports" => array( "title", "editor", "thumbnail", "excerpt", "custom-fields", "comments", "revisions", "author", "page-attributes" ), "taxonomies" => array( "category", "post_tag" ), ); register_post_type( "artists", $args ); $labels = array( "name" => __( 'Featured Venues', '' ), "singular_name" => __( 'Featured Venue', '' ), "menu_name" => __( 'Featured Venue', '' ), "add_new" => __( 'Add Featured Venue', '' ), "add_new_item" => __( 'Add New Featured Venue', '' ), "edit" => __( 'Edit Venue', '' ), "new_item" => __( 'New Featured Venue', '' ), ); $args = array( "label" => __( 'Featured Venues', '' ), "labels" => $labels, "description" => "", "public" => true, "publicly_queryable" => false, "show_ui" => true, "show_in_rest" => false, "rest_base" => "", "has_archive" => true, "show_in_menu" => true, "exclude_from_search" => false, "capability_type" => "post", "map_meta_cap" => true, "hierarchical" => true, "rewrite" => true, "query_var" => true, "supports" => array( "title", "editor", "excerpt", "trackbacks", "custom-fields", "comments", "revisions", "thumbnail", "author", "page-attributes" ), "taxonomies" => array( "category", "post_tag" ), ); register_post_type( "featured-venue", $args ); // End of cptui_register_my_cpts() }
September 8, 2016 at 10:29 am #291061Ok my issue at this end and I have resolved it.
September 8, 2016 at 2:46 pm #291147Hi,
Glad 🙂 to know this.
Thanks
Mohammad -
Posted in: Uplift
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in and have valid license to reply to this topic.