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.

Ok,

So this is a weird issue...WordPress doesn't generate thumbnails, I have my image sizes set and everything...I'm pretty sure it's related to my custom posts type code (see below) because when I remove it the thumbnails generate properly.

// Tells WP to add a slides and marquee sections
add_action( 'init', 'create_my_post_types' );

// WP slides section attributes
function create_my_post_types() {
    // Add Slide Section
    register_post_type( 'slides',
        array(
            'exclude_from_search' => true,
            'labels' => array(
                'name' => __( 'Slides' ),
                'singular_name' => __( 'Slides' ),
                'search_items' => __('Search Slides'),
            ),
                    'public' => true,
                    'publicly_queryable' => true,
                    'show_ui' => true,
                    'query_var' => true,
                    'rewrite' => true,
                    'capability_type' => 'post',
                    'hierarchical' => false,
                    'menu_position' => 5,
                    'supports' => array('title','editor','thumbnail')
        )
    );
    // Add Marquee Section
    register_post_type( 'marquee',
        array(
            'exclude_from_search' => true,
            'labels' => array(
                'name' => __( 'Marquee' ),
                'singular_name' => __( 'Marquee' ),
                'search_items' => __('Search Marquee'),
            ),
                    'public' => true,
                    'publicly_queryable' => true,
                    'show_ui' => true,
                    'query_var' => true,
                    'rewrite' => true,
                    'capability_type' => 'post',
                    'hierarchical' => false,
                    'menu_position' => 6,
                    'supports' => array('title','editor')
        )
    );
}

Anyone see what's wrong with the code or know why this code would interfere with normal thumbnail generation?

Thanks,
Josh

share|improve this question

1 Answer 1

In your custom post type slides you have provided support for thumbnail and When you use custom post type that use thumbnails remember to check that the theme also supports thumbnails or use add_theme_support function.

For more information see the supports parameter on this page.

share|improve this answer
    
Vinod...as I mentioned in my original post, I have added theme support and it's still not working properly...the code I am using for the thumbnails looks like: pastebin.com/t1s9cbLN. Also, this issue doesn't just affect my custom post type, but all thumbnails in-general :( –  Josh Rodgers Mar 13 '13 at 15:23
    
I downloaded and installed wordpress.org/extend/plugins/custom-post-type-maker which is a plugin that creates the custom post types for you and I still have the same issue, even after removing my code for the custom post types...which makes me wonder where the conflict resides, because it's obviously with the post types themselves and not the code. If the plugin is activated the thumbnails fail to generate...if I deactivate the plugin everything works fine. –  Josh Rodgers Mar 13 '13 at 16:26
    
Ok, so I applied the Twenty Twelve theme, just to see what would happen and the thumbnails generate...so now we know something is wrong with my functions file. I took a look at how post thumbnails are added and mine looks like: add_theme_support( 'post-thumbnails', array( 'post','slides' ) ); where Twenty Twelve looks like: add_theme_support( 'post-thumbnails' );...so I simply deleted the array at the end...but that still didn't work! I'm not sure where to go or what to check from here. –  Josh Rodgers Mar 13 '13 at 16:43
    
Are you adding theme support at the same point as twentytwelve? That is, directly into functions.php or within a function attached to the 'after_setup_theme' hook? –  vancoder Mar 13 '13 at 16:57
    
I am adding it directly to functions.php...I have done several other themes, none of which have this problem but none of the other ones are using custom post types. –  Josh Rodgers Mar 13 '13 at 17:01

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.