Skip Navigation

[Resolved] Custom Post Type and Cornerstone

This support ticket is created 7 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Noman 7 years, 1 month ago.

Assisted by: Noman.

Author
Posts
#578475

Tell us what you are trying to do?

I made a new custom post type and I am able to edit it with cornerstone. But when I create a template for my new cpt cornerstone is not able to edit it. It does not show any error. The editor opens but I can not edit anything. In the same time I can edit the custom post type with visual composer.

#578492

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Roman,

Thank you for contacting Toolset support. This looks like between X theme and WP Custom Post Types. Does this work with standard WP Custom Post Types?

You can generate a standard WP cpt using this tool:
hidden link

Have you asked X theme or plugin author -- that how to use Cornerstone for my own custom post types?

Thank you

#578507

I pasted the generated code but nothing appears.

if ( ! function_exists('custom_post_type') ) {

// Register Custom Post Type
function custom_post_type() {

$labels = array(
'name' => _x( 'Apartments', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Apartment', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Post Types', 'text_domain' ),
'name_admin_bar' => __( 'Post Type', 'text_domain' ),
'archives' => __( 'Item Archives', 'text_domain' ),
'attributes' => __( 'Item Attributes', 'text_domain' ),
'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
'all_items' => __( 'All Items', 'text_domain' ),
'add_new_item' => __( 'Add New Item', 'text_domain' ),
'add_new' => __( 'Add New', 'text_domain' ),
'new_item' => __( 'New Item', 'text_domain' ),
'edit_item' => __( 'Edit Item', 'text_domain' ),
'update_item' => __( 'Update Item', 'text_domain' ),
'view_item' => __( 'View Item', 'text_domain' ),
'view_items' => __( 'View Items', 'text_domain' ),
'search_items' => __( 'Search Item', 'text_domain' ),
'not_found' => __( 'Not found', 'text_domain' ),
'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),
'featured_image' => __( 'Featured Image', 'text_domain' ),
'set_featured_image' => __( 'Set featured image', 'text_domain' ),
'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),
'use_featured_image' => __( 'Use as featured image', 'text_domain' ),
'insert_into_item' => __( 'Insert into item', 'text_domain' ),
'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),
'items_list' => __( 'Items list', 'text_domain' ),
'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),
'filter_items_list' => __( 'Filter items list', 'text_domain' ),
);
$args = array(
'label' => __( 'Apartment', 'text_domain' ),
'description' => __( 'Post Type Description', 'text_domain' ),
'labels' => $labels,
'supports' => array( ),
'hierarchical' => true,
'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' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'apartment', $args );

}
add_action( 'init', 'custom_post_type', 0 );

}

#578518

I had a mistake in the above code. So finally the custom post type appeared and I get other type of error from cornerstone. I'm talking with their support. I will update my ticket as long as I get response. Thank you!

#578521

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I see you have pasted the code as it is. First you need to fill out some required data in the options or the form given. Post type name, slug, singular name, plural name etc… (you can skip optional ones). And once it gives you updated code with your added details, then please add it to your site to register a new cpt.

However, on X theme forums I found this post which outline the steps needed on how to enable Custom post types in Cornerstone: hidden link

They list post types under CORNERSTONE >> SETTINGS >> ALLOWED POST TYPES -- from there you need to select which CPTs you want to use with Cornerstone.

Basically the attribute it talks about is “exclude_from_search” should be False, and for any new Post types created with Toolset Types, this option is setup as “false” by default. And you can confirm this by editing your Toolset’s custom post type.

Thanks

#578523

Hello again,

Thank you for your fast response! As I told in my last message, I have corrected the code. Also in cornerstone I add in settings so it can edit the new post type. In cornerstone settings the new post type appears and I selected. But when I click on edit with cornerstone in loads but can not edit the custom post type. I think its their bug, but I still wait their response.
My updated code:

if ( ! function_exists('custom_post_type') ) {

// Register Custom Post Type
function custom_post_type() {

	$labels = array(
		'name'                  => _x( 'Apartments', 'Post Type General Name', 'text_domain' ),
		'singular_name'         => _x( 'Apartment', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'             => __( 'Apartment', 'text_domain' ),
		'name_admin_bar'        => __( 'Apartment', 'text_domain' ),
		'archives'              => __( 'Item Archives', 'text_domain' ),
		'attributes'            => __( 'Item Attributes', 'text_domain' ),
		'parent_item_colon'     => __( 'Parent Item:', 'text_domain' ),
		'all_items'             => __( 'All Items', 'text_domain' ),
		'add_new_item'          => __( 'Add New Item', 'text_domain' ),
		'add_new'               => __( 'Add New', 'text_domain' ),
		'new_item'              => __( 'New Item', 'text_domain' ),
		'edit_item'             => __( 'Edit Item', 'text_domain' ),
		'update_item'           => __( 'Update Item', 'text_domain' ),
		'view_item'             => __( 'View Item', 'text_domain' ),
		'view_items'            => __( 'View Items', 'text_domain' ),
		'search_items'          => __( 'Search Item', 'text_domain' ),
		'not_found'             => __( 'Not found', 'text_domain' ),
		'not_found_in_trash'    => __( 'Not found in Trash', 'text_domain' ),
		'featured_image'        => __( 'Featured Image', 'text_domain' ),
		'set_featured_image'    => __( 'Set featured image', 'text_domain' ),
		'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),
		'use_featured_image'    => __( 'Use as featured image', 'text_domain' ),
		'insert_into_item'      => __( 'Insert into item', 'text_domain' ),
		'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),
		'items_list'            => __( 'Items list', 'text_domain' ),
		'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),
		'filter_items_list'     => __( 'Filter items list', 'text_domain' ),
	);
	$args = array(
		'label'                 => __( 'Apartment', 'text_domain' ),
		'description'           => __( 'Post Type Description', 'text_domain' ),
		'labels'                => $labels,
		'supports'              => array( ),
		'hierarchical'          => true,
		'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'           => true,		
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'capability_type'       => 'page',
	);
	register_post_type( 'apartment', $args );

}
add_action( 'init', 'custom_post_type', 0 );

}
#578593

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Sorry I missed your last message as that came in while I was typing. So as I understand now, that the issue still occurs when you register a standard WP post type called “Apartments” (non-Toolset post type).

As such this is definitely something X theme or plugin author needs to check themself because the problem still occurs between standard WP post types + Cornerstone.

If we are missing something here, please let me know. Thank you