Title: Color Posts
Author: Jeremy Herve
Published: <strong>2014 年 8 月 6 日</strong>
Last modified: 2026 年 5 月 22 日

---

搜尋外掛

![](https://ps.w.org/color-posts/assets/banner-772x250.jpg?rev=2506870)

![](https://ps.w.org/color-posts/assets/icon-256x256.jpg?rev=2506870)

# Color Posts

 由 [Jeremy Herve](https://profiles.wordpress.org/jeherve/) 開發

[下載](https://downloads.wordpress.org/plugin/color-posts.1.6.2.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/color-posts/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/color-posts/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/color-posts/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/color-posts/#developers)

 [技術支援](https://wordpress.org/support/plugin/color-posts/)

## 外掛說明

Color Posts grabs an image from your post, samples it, creates a matching color 
and a contrast value (black or white), and changes the post’s background color to
match the image.
 It also changes the background color of your window in Chrome 
for Android, and customizes the look of the AMP default template if you use [the AMP plugin](https://wordpress.org/plugins/amp/).

If you’re not happy with the automatically picked color, you can define your own
custom color thanks to the “Post Color” meta box in the post editor.

If you’d like to use post colors via the REST API, you can use the `colors` field
in the post response.

Important: for this plugin to work, you must activate [Jetpack](https://wordpress.org/plugins/jetpack/)
first.

If you find bugs, you can report them [here](https://wordpress.org/support/plugin/color-posts),
or submit a pull request [on GitHub](https://github.com/jeherve/color-posts/).

You can read more about how the plugin works here: [Color Posts plugin: how to use Jetpack libs in your plugin](http://jeremy.hu/color-posts-jetpack-plugin/)

## 安裝方式

 1. Install the Jetpack plugin
 2. Install the Color Posts plugin via the WordPress.org plugin repository, or via 
    your dashboard
 3. Activate the plugin
 4. Enjoy! 🙂

## 常見問題集

### I don’t want to change the background color on my site, but I’d like to use this plugin to change other elements on my site

No problem! You can build your own CSS from the colors grabbed by the plugin, like
so:

    ```
    function jeherve_use_custom_colors( $colors_css, $color, $contrast ) {
        $post_id = get_the_ID();

        $tonesque = get_post_meta( $post_id, '_post_colors', true );
        extract( $tonesque );

        $colors_css = ".post a {
            color: #{$color};
        }";

        return $colors_css;
    }
    add_filter( 'colorposts_css_output', 'jeherve_use_custom_colors', 10, 3 );
    ```

### I don’t want Jetpack to choose the base image for me. I want to use my own image

You can do so thanks to the `colorposts_image_output` filter, like so:

    ```
    function jeherve_use_custom_image( $the_image ) {
        $the_image = 'http://f.cl.ly/items/3z0o2k2F3w0D0p0k1Y35/cool.gif'; // Whatever image you want, you could grab it from a custom field
        return esc_url( $the_image );
    }
    add_filter( 'colorposts_image_output', 'jeherve_use_custom_image' );
    ```

### How do I change the default color that is assigned to posts without an image

You can define a default image that will be used to create a color for all posts
that don’t include an image.
 To do so, you can use the `jetpack_open_graph_image_default`
filter, like so:

    ```
    function jeherve_custom_colors_default_img( $the_image ) {
        $the_image = 'http://f.cl.ly/items/3z0o2k2F3w0D0p0k1Y35/cool.gif'; // Whatever image you want, you could grab it from a custom field
        return esc_url( $the_image );
    }
    add_filter( 'jetpack_open_graph_image_default', 'jeherve_custom_colors_default_img' );
    ```

## 使用者評論

![](https://secure.gravatar.com/avatar/fb46e1523561a5368295c949a1c944d4a57f1a9f2a25f3595c2d0d6781eca192?
s=60&d=retro&r=g)

### 󠀁[Nice!](https://wordpress.org/support/topic/nice-3875/)󠁿

 [](https://profiles.wordpress.org/mrwindowsx/) 2021 年 3 月 19 日

Great plugin, keep this updated frequently.

![](https://secure.gravatar.com/avatar/63f2d1698f6479be3ae3820cb0651765092b8ce4bf2b6dfd1bee3fd0f952c199?
s=60&d=retro&r=g)

### 󠀁[Complete Waste of Time](https://wordpress.org/support/topic/complete-waste-of-time-3/)󠁿

 [net3431](https://profiles.wordpress.org/net3431/) 2016 年 9 月 3 日 2 則留言

I installed Jetpack. I installed the "Color Post" plugin. I set the color. It did
nothing. I uninstalled the "Color Post" plugin. I uninstalled Jetpack. I feel like
I just got scammed.

 [ 閱讀全部 3 則使用者評論 ](https://wordpress.org/support/plugin/color-posts/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Color Posts〉的開發相關工作。

參與者

 *   [ Jeremy Herve ](https://profiles.wordpress.org/jeherve/)

〈Color Posts〉外掛目前已有 1 個本地化語言版本。 感謝[全部譯者](https://translate.wordpress.org/projects/wp-plugins/color-posts/contributors)
為這個外掛做出的貢獻。

[將〈Color Posts〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/color-posts)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/color-posts/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/color-posts/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/color-posts/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/color-posts/)。

## 變更記錄

#### 1.6.2

Release Date: August 26, 2022

 * Compatibility: update how the plugin relies on functionality provided by the 
   Jetpack plugin, to ensure full compatibility with upcoming versions of the Jetpacak
   plugin.

#### 1.6.1

Release Date: March 31, 2021

 * Internationalization: remove custom translation implementation, WordPress’ language
   packs handle everything these days.
 * Custom contrast value: avoid issues when saving new value.
 * Ensure the values saved and displayed are always as expected.

#### 1.6

 * Admin interface: add the meta box to all public post types.

#### 1.5.2

 * Fix error when the WP REST API plugin wasn’t installed on a site.

#### 1.5.1

 * Fix Fatal Error on post update.

#### 1.5

 * You can now set your own custom color if you don’t like the one that’s automatically
   calculated from the post image.
    - You can do so from a color picker in the post and page editor.
    - If you don’t touch the color picker, the plugin keeps using the post image
      to calculate a post color.
    - As soon as you touch the color picker, the plugin uses that color instead.
 * Refactoring to accommodate the new admin interface.
 * REST API: Allow defining custom color via the API.

#### 1.4

 * Add colors to AMP’s Default template if you use [the AMP plugin](https://wordpress.org/plugins/amp/).

#### 1.3

 * Add colors to REST API Post response.

#### 1.2

 * Add background color to Chrome for Android.
 * Display custom colors on pages as well.

#### 1.1

 * Add default fallback image and documentation.

#### 1.0

 * Initial release.

## 中繼資料

 *  版本 **1.6.2**
 *  最後更新 **5 個月前**
 *  啟用安裝數 **20+**
 *  WordPress 版本需求 ** 4.7 或更新版本 **
 *  已測試相容的 WordPress 版本 **7.0.7**
 *  語言
 * [English (US)](https://wordpress.org/plugins/color-posts/) 及 [French (France)](https://fr.wordpress.org/plugins/color-posts/).
 *  [將這個外掛本地化為你的母語版本](https://translate.wordpress.org/projects/wp-plugins/color-posts)
 * 標籤:
 * [colors](https://tw.wordpress.org/plugins/tags/colors/)[jetpack](https://tw.wordpress.org/plugins/tags/jetpack/)
   [posts](https://tw.wordpress.org/plugins/tags/posts/)[theme](https://tw.wordpress.org/plugins/tags/theme/)
 *  [進階檢視](https://tw.wordpress.org/plugins/color-posts/advanced/)

## 評分

 3.7 星，滿分為 5 星

 *  [  2 個 5 星使用者評論     ](https://wordpress.org/support/plugin/color-posts/reviews/?filter=5)
 *  [  0 個 4 星使用者評論     ](https://wordpress.org/support/plugin/color-posts/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/color-posts/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/color-posts/reviews/?filter=2)
 *  [  1 個 1 星使用者評論     ](https://wordpress.org/support/plugin/color-posts/reviews/?filter=1)

[撰寫評分](https://wordpress.org/support/plugin/color-posts/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/color-posts/reviews/)

## 參與者

 *   [ Jeremy Herve ](https://profiles.wordpress.org/jeherve/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/color-posts/)