首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >缩略图不生成

缩略图不生成
EN

WordPress Development用户
提问于 2013-03-13 00:17:12
回答 1查看 941关注 0票数 0

好的,

所以这是一个奇怪的issue...WordPress不生成缩略图,我设置了我的图像大小和所有东西.我很确定它与我的自定义帖子类型代码有关(见下面),因为当我删除它时,缩略图就生成了。

代码语言:javascript
运行
复制
// 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')
        )
    );
}

有人知道代码有什么问题,或者知道为什么这段代码会干扰正常的缩略图生成?

谢谢,

乔希

EN

回答 1

WordPress Development用户

发布于 2013-03-13 04:06:09

在自定义的post类型幻灯片中,您已经提供了对缩略图的支持,当您使用使用缩略图的自定义post类型时,请记住要检查主题是否也支持缩略图或使用添加_主题_支持函数。

有关更多信息,请参见此页上的支持参数。

票数 1
EN
页面原文内容由WordPress Development提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://wordpress.stackexchange.com/questions/90608

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档