Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have the following in functions.php of my custom theme:

<?php
add_theme_support( 'post-thumbnails' );
add_image_size( "main-slider", 671, 252, true );

add_action( 'init', 'create_main_slider_post_type' );
add_action( 'init', 'create_external_link_post_type' );

function create_main_slider_post_type() {
    register_post_type( 'main_slider_item',
        array(
            'labels' => array(
                                  'name' => __( 'Main Slider Items' ),
                                  'singular_name' => __( 'Main Slider Item' ),
                                  'menu_name' => __( 'Main Slider' )
                        ),
                        'description' => "A banner with a text and button",
                        'public' => false,
                        'show_ui' => true,
                        'exclude_from_search' => true,
                        'show_in_nav_menus' => false,
                        'map_meta_cap' => false,
                        'supports' => array('title', 'thumbnail'),
                        'has_archive' => false,
                        'show_in_nav_menus' => false,
        )
    );
}

function create_external_link_post_type() {
    register_post_type( 'external_link',
        array(
            'labels' => array(
                                  'name' => __( 'External Links' ),
                                  'singular_name' => __( 'External Link' ),
                        ),
                        'description' => "A link with image for site footer",
                        'public' => false,
                        'show_ui' => true,
                        'exclude_from_search' => true,
                        'show_in_nav_menus' => false,
                        'map_meta_cap' => false,
                        'supports' => array('title', 'thumbnail'),
                        'has_archive' => false,
                        'show_in_nav_menus' => false,
        )
    );
}
?>

This code works, as this is confirmed by seeing "Main Slider" and "External Links" in the dashboard.

In config of "Advanced Custom Fields" there disappeared main_slider_item as a possible value for "Post Type". (It shows only "post" and "page" post content types.) It was there earlier.

Where to dig?

I tried to disable every active plugin, but this hasn't helped.

share|improve this question
1  
"In config of "Advanced Custom Fields" there disappeared main_slider_item as a possible value for "Post Type". (It shows only "post" and "page" post content types.) It was there earlier." - So, what changed between then and now? Did you update core, your Theme, any Plugins? Any other changes? –  Chip Bennett Mar 8 '12 at 17:11
    
And PLEASE follow your other Qs, before adding new ones. Thank you. –  kaiser Mar 8 '12 at 17:13
    
@Chip Bennett: I don't remember what exactly I have changed. But I've tried to disable every other plugin except of Advanced Custom Fields. This does not help. –  porton Mar 8 '12 at 18:08

1 Answer 1

up vote 0 down vote accepted

For post type to appear I need to see 'public' => true, in register_post_type().

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.