Support » Fixing WordPress » White screen after adding custom post type support

  • Resolved timm49


    Hi all,

    I know this problem is mentioned 100 times before already as I have tried to find my answer before posting, but I’m getting too annoyed.

    After adding some code to get a custom post type to the functions.php of my theme I’m creating, every time I’m updating a post, I get the white/blank screen.

    I tried increasing the memory limit, I have NO plugins installed, and I even tried to setup a totally new and fresh wordpress installation, but same thing happens there.

    When I switch to standard WP theme, there’s no problem. Same goes for removing the custom post type code, then everything suddenly works fine again. Don’t see anything bad in that code though.

    The custom post type appears in the menu btw, so it does work.

    Anyone has an idea? Thanks!!

    add_action( 'init', 'create_post_type' );
    function create_post_type() {
        register_post_type( 'festivals',
                'labels' => array(
                    'name' => __( 'Festivals' ),
                    'singular_name' => __( 'Festival' ),
                    'add_new_item' => __('New festival'),
                    'add_new' => __('Add'),
                    'edit_item' => __('Edit festival'),
                    'new_item' => __('New festival'),
                    'all_items' => __('All festivals'),
                    'view_item' => __('View festival'),
                    'search_items' => __('Search festivals'),
                    'not_found' =>  __('No festivals found'),
                    'not_found_in_trash' => __('No festivals found in Trash'),
                    'parent_item_colon' => '',
                    'menu_name' => 'Festivals'
            'public' => true,
            'has_archive' => true,
Viewing 3 replies - 1 through 3 (of 3 total)
  • This is why I ask questions on forums – somehow always right after doing that I’m able to fix it myself…so weird.

    I still don’t believe the error was actually because of this, but this is what fixed it – there were 2 empty lines (created by using <enter>) at the bottom of the functions.php file…

    Really..? That could be it? I can’t believe it but hitting enter at the bottom of the file again, and the error is back!

    So I’ll mar it as solved btw 🙂

    Thank you for posting back your solution, panic attack averted!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘White screen after adding custom post type support’ is closed to new replies.