【问题标题】:Multiple Featured Images Wordpress多个特色图片 Wordpress
【发布时间】:2011-09-30 12:38:53
【问题描述】:

因此,我的目标是找到一种添加更多缩略图的方法,仅用于在自定义帖子类型上显示,例如,我希望为特色帖子提供大图像(不是同一图像),为默认帖子提供不同的图像查看。

【问题讨论】:

    标签: wordpress


    【解决方案1】:

    最后我遵循了这个教程,它完全符合我对 T 的要求。

    http://www.lifeonlars.com/wordpress/how-to-add-multiple-featured-images-in-wordpress

    【讨论】:

    【解决方案2】:

    你试过这个add_image_size

    你为什么不使用custom post template plugin

    【讨论】:

    • (不是同一张图片)-抱歉,我只是复制同一张图片,我希望有不同的视觉效果。
    • Xavier:你能澄清一下你的问题吗
    • @Xavier:自定义帖子模板插件怎么样。使用此插件拥有多个特色图片很简单
    【解决方案3】:

    我从网上得到了解决方案。我还定制了一些代码。你可以检查一下。

    第 1 步 从此link 下载此库并放在functions.php 旁边(主题根)。

    第 2 步: 将此代码复制到 functions.php

    /*
     * Code for Multiple Featured Image.
     * Multiple Featured image is only for your selected post type.
     */
    require_once('library/multi-post-thumbnails.php');
    if (class_exists('MultiPostThumbnails')) {
    new MultiPostThumbnails(array(
        'label' => '2nd Feature Image',
        'id' => 'feature-image-2',
        'post_type' => 'your_post_type_name'
            )
    );
    new MultiPostThumbnails(array(
        'label' => '3rd Feature Image',
        'id' => 'feature-image-3',
        'post_type' => 'your_post_type_name'
            )
    );
    new MultiPostThumbnails(array(
        'label' => '4th Feature Image',
        'id' => 'feature-image-4',
        'post_type' => 'your_post_type_name'
            )
    );
    };
    

    第 3 步立即检查。

    【讨论】:

      【解决方案4】:

      我可以在这里写完整的代码,但是点击这个tutorial link 更容易:)

      【讨论】:

        猜你喜欢
        • 2014-05-13
        • 2012-01-16
        • 2019-07-31
        • 2015-04-28
        • 2015-07-17
        • 2014-11-22
        • 2015-04-12
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多