PHPackages                             starise/post-thumbnails - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. starise/post-thumbnails

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

starise/post-thumbnails
=======================

PostThumbnails Class for Wordpress. Enables multiple post thumbnails for post type.

3.0.0(11y ago)0121GPL-2.0PHPPHP &gt;=5.4.0

Since Jan 31Pushed 11y ago1 watchersCompare

[ Source](https://github.com/starise/Post-Thumbnails)[ Packagist](https://packagist.org/packages/starise/post-thumbnails)[ Docs](https://github.com/starise/Post-Thumbnails)[ RSS](/packages/starise-post-thumbnails/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

WordPress Post-Thumbnails
=========================

[](#wordpress-post-thumbnails)

PostThumbnails Class for Wordpress. Enables multiple post thumbnails for post type.

Requirements
------------

[](#requirements)

- PHP &gt;= 5.4
- WordPress &gt;= 3.5

Quick Start
-----------

[](#quick-start)

First, in your theme's `functions.php` (or you can create a shim plugin that does this on the `wp_loaded` action) register a thumbnail. To do this, create a new `PostThumbnails` instance and pass in an array of arguments:

```
use starise\PostThumbnails as PostThumbnails;

new PostThumbnails(
    [
        'label' => 'Secondary Image',
        'id' => 'secondary-image',
        'post_type' => ['post']
    ]
);
```

The template tag `PostThumbnails::the_post_thumbnail` is similar to WordPress' `the_post_thumbnail` but it displays your custom thumbnail in a post loop:

```
