开发者

Wordpress post thumbnails (featured image) metabox not appearing in custom post

I've enabled featured images with the following code:

if(function_exists('add_theme_support')){
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(145, 9999999999999999999999999999999999999999999, false);
}

and everything works fine except that I can't find the featured image metabox in my custom post editor. Under the "show" menu I only have the number of column and other 2 unrelated options. I'm on the last version of wordpress (3.1, I think?).

Can you help me? I've already tried everything I found on this website and elsewhere.

Thanks in advance开发者_Python百科.


The correct way to do this is inserting all this code in functions.php

add_theme_support('post-thumbnails', array('events'));

(where events is the name of my custom post, you should use yours)

function create_event() {
    register_post_type( 'events',
         array(
            //...
            'supports' => array('thumbnail', 'title', 'editor')
                    //...
        )
    );

(thumbnail does the trick, but don't forget title and editor if you want to be able to have a title in your post or edit it!)

And last be sure to tick the box called 'thumbnail' - I suppose, my installation is in another language - under screen options (screen options is a button in the upper right corner, Google the name if you can't find it).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜