April 18, 2012 at 12:26 pm #11545
I created my own custom post type using Custom Post Type UI.
But whenever I save (publish or save already published post types) one of them the page goes blank showing only “-1” (source code is empty too). I was able to create new entries a drafts.
All changes I make during editing one entry are saved (reloading the front view of the current entry).
Then I deleted this post type and created my own one basically using this tutorial http://net.tutsplus.com/tutorials/wordpress/ (Purchase code hidden if logged out) – (Purchase code hidden if logged out) /. The error keeps the same.
Regular posts and pages are not affected.
I checked my code and the functions.php, but besides adding my own custom post type I did not change anything.
What can be the problem? I really hope you can help me. Thanks in advance.
Edit: Needless to say that I already checked deactivating Brightbox – the error was gone.
Another thing I noticed: the URL after saving does not contain the post ID and the message, like “post.php?post=123&action=edit&message=1”, it ends with “post.php”.April 19, 2012 at 9:24 am #72113
A litte update:
I managed to adapt the existing Brightbox portfolio post type to fit my needs (I dont need categories but added custom fields). This is working fine.
But I cannot change the name from “portfolio” to any other name. Then I get the “-1” error.
Plus: I really need another post type – this always results in the error “-1”.
What do I have to change to get a second post type working properly?
This is my adapted and working code:
$labels = array(
'name' => _x('Themen + Frequenzen', 'post type general name'),
'singular_name' => _x('Ausgabe', 'post type singular name'),
'add_new' => _x('Neue Ausgabe', 'portfolio'),
'add_new_item' => __('Neue Ausgabe erstellen'),
'edit_item' => __('Ausgabe bearbeiten'),
'new_item' => __('Neue Ausgabe erstellen'),
'view_item' => __('Ausgabe ansehen'),
'search_items' => __('Ausgaben durchsuchen'),
'not_found' => __('Keine Einträge gefunden'),
'not_found_in_trash' => __('Keine Einträge im Papierkorb vorhanden'),
'parent_item_colon' => ''
$args = array(
'labels' => $labels,
'public' => true,
'show_ui' => true,
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => array('slug'=>'themen-frequenzen','with_front'=>true),
'query_var' => true,
'supports' => array('title','editor')
register_post_type( 'portfolio' , $args );
}April 19, 2012 at 9:54 am #72114
As far as I know this error occured in an old version of Brightbox – newer versions (eg the latest 1.2.2) should not cause any troubles with custom post types. Which version are you using?
PeterApril 19, 2012 at 10:02 am #72115
Thank you Peter, this could be the problem. I am using version 1.1.
Can I download a newer version in my themeforest account?
NadjaApril 19, 2012 at 11:39 am #72116
Yes, exactly. Just log in and go to the “Downloads” area to download the latest version.
PeterApril 19, 2012 at 12:59 pm #72117April 19, 2012 at 1:21 pm #72118
The topic ‘Custom Post Type saving error "-1"’ is closed to new replies.