Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #11545

    Hi,

    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/rock-solid-wordpress-3-0-themes-using-custom-post-types/. 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.

    Nadja

    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”.

    #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:

    add_action('init', 'tf_register');

    function tf_register()
    {
    $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,
    'show_in_nav_menus'=> false,
    'supports' => array('title','editor')
    );

    register_post_type( 'portfolio' , $args );
    }

    #72114

    Hey!

    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?

    Regards,

    Peter

    #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?

    Nadja

    #72116

    Hey!

    Yes, exactly. Just log in and go to the “Downloads” area to download the latest version.

    Best regards,

    Peter

    #72117

    Hi Peter,

    I just updated the files, so everything is working fine.

    Thank you.

    #72118

    Hi!

    Great :)

    Regards,

    Peter

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Custom Post Type saving error "-1"’ is closed to new replies.