October 11, 2011 at 8:57 pm #6341
In working with the upScale I have the requirement to add custom post types. I have tried a few ways including:
– two separate “post type UI” plugins that let you create custom post types from a wordpress admin user interface
– and hand coding a function for a post type into the functions.php file
All the ways I have tried result in the same error. When you go into the custom post type to create a post everything is fine until you hit “Publish” at which point all I get in the browser is a blank page with “-1” in the top left corner. Once I navigate away from this page I can return to the post type and the created post appears as a draft, however when I click into the post and hit publish I get the same error.
I have pasted the function I coded into the functions.php below and any help would be appreciated in pointing me in the right direction as to how to create custom post types within this theme (and possibly the wider Avia Framework).
register_post_type('Bulletins', array( 'label' => 'OFM Bulletins','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => ''),'query_var' => true,'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes',),'labels' => array (
'name' => 'OFM Bulletins',
'singular_name' => 'OFM Bulletin',
'menu_name' => 'OFM Bulletins',
'add_new' => 'Add OFM Bulletin',
'add_new_item' => 'Add New OFM Bulletin',
'edit' => 'Edit',
'edit_item' => 'Edit OFM Bulletin',
'new_item' => 'New OFM Bulletin',
'view' => 'View OFM Bulletin',
'view_item' => 'View OFM Bulletin',
'search_items' => 'Search OFM Bulletins',
'not_found' => 'No OFM Bulletins Found',
'not_found_in_trash' => 'No OFM Bulletins Found in Trash',
'parent' => 'Parent OFM Bulletin',
),) );October 13, 2011 at 5:05 pm #53807October 14, 2011 at 7:22 am #53809
Hey! Which version of upscale are you using? Thats a framework error that should have been fixed some time ago, so if you update to the latest version using custom post types should no longer be a problem :)October 14, 2011 at 10:38 pm #53810
Upgraded and it works just fine now. Thanks for your help and great support.
David MaguireOctober 16, 2011 at 8:25 am #53811
The topic ‘Can't create custom post types’ is closed to new replies.