PHPackages                             ankitpokhrel/dynamic-featured-image - 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. ankitpokhrel/dynamic-featured-image

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

ankitpokhrel/dynamic-featured-image
===================================

Dynamically adds multiple featured image (post thumbnail) functionality to posts, pages and custom post types.

v3.7.0(7y ago)1083733[9 issues](https://github.com/ankitpokhrel/Dynamic-Featured-Image/issues)GPL-2.0-or-laterPHP

Since Feb 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ankitpokhrel/Dynamic-Featured-Image)[ Packagist](https://packagist.org/packages/ankitpokhrel/dynamic-featured-image)[ RSS](/packages/ankitpokhrel-dynamic-featured-image/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (1)Versions (20)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/efa28d620f99568969ddde60cb135b89ee453654b3cd01f8ee2c55540b42bcfb/68747470733a2f2f696d672e736869656c64732e696f2f776f726470726573732f706c7567696e2f762f64796e616d69632d66656174757265642d696d6167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ankitpokhrel/Dynamic-Featured-Image)[![WordPress](https://camo.githubusercontent.com/0f65a9a903744290093f5d3dbd6ae3f71ae749456f6f2970cb8e71f9880d5309/68747470733a2f2f696d672e736869656c64732e696f2f776f726470726573732f762f64796e616d69632d66656174757265642d696d6167652e7376673f7374796c653d666c61742d737175617265)](https://wordpress.org/plugins/dynamic-featured-image/)[![WordPress Rating](https://camo.githubusercontent.com/a0328999b048ad873267016ee43122879f810047924c29e0cf0190fdc6d22821/68747470733a2f2f696d672e736869656c64732e696f2f776f726470726573732f706c7567696e2f722f64796e616d69632d66656174757265642d696d6167652e7376673f7374796c653d666c61742d737175617265)](https://wordpress.org/plugins/dynamic-featured-image/)[![License](https://camo.githubusercontent.com/0c1d3793bf5a62156f96bb95c8a59a2aa22142c0609237621fd7c9c8886d05c9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616e6b6974706f6b6872656c2f64796e616d69632d66656174757265642d696d6167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ankitpokhrel/dynamic-featured-image)

Dynamic Featured Image (A WordPress Plugin)
-------------------------------------------

[](#dynamic-featured-image-a-wordpress-plugin)

> This project is no longer actively maintained.

[![Download](https://camo.githubusercontent.com/27dbe314bd6fa08e5d22a53f713e24004fc2c05cde0bb62f63b4785dfbd2a100/68747470733a2f2f696d672e736869656c64732e696f2f776f726470726573732f706c7567696e2f64742f64796e616d69632d66656174757265642d696d6167652e7376673f7374796c653d666c61742d737175617265)](https://wordpress.org/plugins/dynamic-featured-image)[![Build](https://camo.githubusercontent.com/3a4891fe2a45b524dac253a2c8435a596104204ee4c07215044e5098b9efd512/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616e6b6974706f6b6872656c2f44796e616d69632d46656174757265642d496d6167652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/ankitpokhrel/Dynamic-Featured-Image)[![Code Coverage](https://camo.githubusercontent.com/59ab39d14a03a02e81f8d085f58092c48dc363f02d6f03adccc2cca5e5aec5c4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f616e6b6974706f6b6872656c2f44796e616d69632d46656174757265642d496d6167652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ankitpokhrel/Dynamic-Featured-Image/)

*Dynamically adds multiple featured image (post thumbnail) functionality to posts, pages and custom post types.*

### Overview

[](#overview)

Why limit yourself to only one featured image if you can do some awesome stuffs with multiple featured image? Dynamic Featured Image enables the option to have MULTIPLE featured images within a post or page. It allows you to add different number of featured images to each post and page that can be collected by the various theme functions. This is especially helpful when you use other plugins, post thumbnails or sliders that use featured images.

### Installation

[](#installation)

1. Unzip and upload the `dynamic-featured-images` directory to the plugin directory (`/wp-content/plugins/`) or install it from `Plugins->Add New->Upload`
2. Activate the plugin through the `Plugins` menu in WordPress.
3. If you don't see new featured image box, click `Screen Options` in the upper right corner of your wordpress admin and make sure that the `Featured Image 2` box is selected.

### Bower

[](#bower)

```
bower install dynamic-featured-image

```

### How it works?

[](#how-it-works)

1. After successful plugin activation go to `add` or `edit` page of posts or pages and you will notice a box for second featured image.

[![New featured image box](.github/screenshots/1.png)](.github/screenshots/1.png)

2. Click `Set featured image` icon, select required image from the "Dynamic Featured Image Media Selector" popup and click `Set Featured Image`.

[![Dynamic Featured Image Media Selector](.github/screenshots/2.png)](.github/screenshots/2.png)

3. Click on `Add New` to add new featured image or use `Remove` link to remove the featured image box.

[![Featured Images](.github/screenshots/3.png)](.github/screenshots/3.png)
[![Featured Images](.github/screenshots/4.png)](.github/screenshots/4.png)

4. After adding featured images click `publish` or `update` to save featured images.

###### *Note: The featured images are only saved when you publish or update the post.*

[](#note-the-featured-images-are-only-saved-when-you-publish-or-update-the-post)

### Documentation

[](#documentation)

- [Retrieving images in a theme](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/Retrieving-data-in-a-theme)
- [Getting image title, alt and caption attributes](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API-Functions#wiki-getting-image-title-alt-and-caption-attributes)
- [API](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API)

### Other Resources

[](#other-resources)

- [Blog](https://ankitpokhrel.com/explore/category/dynamic-featured-image/)
- [FAQs](https://wordpress.org/plugins/dynamic-featured-image/faq/)
- [StackOverflow Tag](https://stackoverflow.com/questions/tagged/dynamic-featured-image)

#### List of Available Functions

[](#list-of-available-functions)

1. [get\_image\_id( $image\_url )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-1-get_image_id-image_url-)
2. [get\_image\_thumb( $image\_url, $size = "thumbnail" )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-2-get_image_thumb-image_url-size--thumbnail-)
3. [get\_image\_url( $attachment\_id, $size = "full" )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-3-get_image_url-attachment_id-size--full-)
4. [get\_post\_attachment\_ids( $post\_id )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-4-get_post_attachment_ids-post_id-)
5. [is\_attached( $attachment\_id, $post\_id )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-5-is_attached-attachment_id-post_id-)
6. [get\_image\_title( $image\_url )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-6-get_image_title-image_url-)
7. [get\_image\_title\_by\_id( $attachment\_id )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-7-get_image_title_by_id-attachment_id-)
8. [get\_image\_alt( $image\_url )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API-Functions#wiki-8-get_image_alt-image_url-)
9. [get\_image\_alt\_by\_id( $attachment\_id )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-9-get_image_alt_by_id-attachment_id-)
10. [get\_image\_caption( $image\_url )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-10-get_image_caption-image_url-)
11. [get\_image\_caption\_by\_id( $attachment\_id )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-11-get_image_caption_by_id-attachment_id-)
12. [get\_image\_description( $image\_url )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-12-get_image_description-image_url-)
13. [get\_image\_description\_by\_id( $attachment\_id )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-13-get_image_description_by_id-attachment_id-)
14. [get\_nth\_featured\_image( $position, $post\_id )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#wiki-14-get_nth_featured_image-position-post_id--null-)
15. [get\_all\_featured\_images( $post\_id )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#15-get_all_featured_images-post_id-)
16. [get\_featured\_images( $post\_id )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#16-get_featured_images-post_id-)
17. [get\_link\_to\_image( $attachment\_id )](https://github.com/ankitpokhrel/Dynamic-Featured-Image/wiki/API#17-get_link_to_image-attachment_id-)

### Allowing DFI only in specific post types

[](#allowing-dfi-only-in-specific-post-types)

You can use `dfi_post_types` filter to allow DFI only in a specific post types.

```
function allowed_post_types() {
    return array('post'); //show DFI only in post
}
add_filter('dfi_post_types', 'allowed_post_types');

```

### Blocking DFI

[](#blocking-dfi)

Use `dfi_post_type_user_filter` filter to block DFI from post types.

```
function blocked_post_types() {
    return array('page'); //block DFI in page
}
add_filter('dfi_post_type_user_filter', 'blocked_post_types');

```

### Changing the metabox default text

[](#changing-the-metabox-default-text)

Use `dfi_set_metabox_title` filter to change the metabox default title (Featured Image)

```
function set_metabox_title( $title ) {
    return "My custom metabox title";
}
add_filter('dfi_set_metabox_title', 'set_metabox_title');

```

### Translation Guidelines

[](#translation-guidelines)

All translations live in the `languages` folder.

If you are interested in translating the plugin in your language, first make sure if the translation is not already available. The name of the file is important because there’s a particular format you should follow for consistency. For example, if you’re translating Nepali for Nepal, the file should be `dynamic-featured-image-ne_NP.po` – `dynamic-featured-image` for the plugin itself, `ne` for the language and `NP` for the country.

### Development

[](#development)

1. Install [PHPUnit](https://phpunit.de/) and [composer](https://getcomposer.org/) if you haven't already.
2. Install required dependencies ```
    $ composer install
    ```
3. Build test using installation script ```
    $ ./bin/install-wp-tests.sh    [db-host] [wp-version] [skip-database-creation]
    ```
4. Run tests with phpunit ```
    $ ./vendor/bin/phpunit
    ```
5. Validate changes against [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards)```
    $ phpcs
    ```

### Questions about this project?

[](#questions-about-this-project)

Please feel free to report any bug found. Pull requests, issues, and plugin recommendations are more than welcome!

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 95.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~104 days

Recently: every ~152 days

Total

19

Last Release

2587d ago

Major Versions

v2.0.2 → v3.0.02014-02-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/07f2aef5d1e12e750ce5f46b0f7d845fc134b911511fb6b46eddda8a1a783152?d=identicon)[ankitpokhrel](/maintainers/ankitpokhrel)

---

Top Contributors

[![ankitpokhrel](https://avatars.githubusercontent.com/u/2364546?v=4)](https://github.com/ankitpokhrel "ankitpokhrel (393 commits)")[![cfoellmann](https://avatars.githubusercontent.com/u/1256090?v=4)](https://github.com/cfoellmann "cfoellmann (4 commits)")[![zsmartin](https://avatars.githubusercontent.com/u/8852521?v=4)](https://github.com/zsmartin "zsmartin (3 commits)")[![tom-henderson](https://avatars.githubusercontent.com/u/447569?v=4)](https://github.com/tom-henderson "tom-henderson (2 commits)")[![danielbachhuber](https://avatars.githubusercontent.com/u/36432?v=4)](https://github.com/danielbachhuber "danielbachhuber (1 commits)")[![ahmednuaman](https://avatars.githubusercontent.com/u/99223?v=4)](https://github.com/ahmednuaman "ahmednuaman (1 commits)")[![isudnop](https://avatars.githubusercontent.com/u/5466944?v=4)](https://github.com/isudnop "isudnop (1 commits)")[![S8nsick66](https://avatars.githubusercontent.com/u/6665738?v=4)](https://github.com/S8nsick66 "S8nsick66 (1 commits)")[![swiffer](https://avatars.githubusercontent.com/u/2990373?v=4)](https://github.com/swiffer "swiffer (1 commits)")[![tobros91](https://avatars.githubusercontent.com/u/4538330?v=4)](https://github.com/tobros91 "tobros91 (1 commits)")[![vlad-stratulat](https://avatars.githubusercontent.com/u/4760396?v=4)](https://github.com/vlad-stratulat "vlad-stratulat (1 commits)")[![glebkema](https://avatars.githubusercontent.com/u/3881568?v=4)](https://github.com/glebkema "glebkema (1 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")[![bogdanfix](https://avatars.githubusercontent.com/u/3281210?v=4)](https://github.com/bogdanfix "bogdanfix (1 commits)")[![bruno-rodrigues](https://avatars.githubusercontent.com/u/7862345?v=4)](https://github.com/bruno-rodrigues "bruno-rodrigues (1 commits)")

---

Tags

featured-imagemade-in-nepalphppost-thumbnailswordpresswordpress-developmentwordpress-pluginwordpress plugindynamic featured imagemultiple featured imagemultiple post thumbnails

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ankitpokhrel-dynamic-featured-image/health.svg)

```
[![Health](https://phpackages.com/badges/ankitpokhrel-dynamic-featured-image/health.svg)](https://phpackages.com/packages/ankitpokhrel-dynamic-featured-image)
```

###  Alternatives

[log1x/navi

A developer-friendly alternative to the WordPress NavWalker.

367633.2k7](/packages/log1x-navi)[wpmetabox/meta-box

The most powerful &amp; comprehensive plugin to create, manage, show and connect dynamic data with forms and custom fields effortlessly on WordPress.

1.2k20.5k3](/packages/wpmetabox-meta-box)[freemius/wordpress-sdk

Freemius WordPress SDK

303101.4k4](/packages/freemius-wordpress-sdk)[log1x/acf-editor-palette

A replica Gutenberg color picker field for Advanced Custom Fields.

100284.1k](/packages/log1x-acf-editor-palette)[hellonico/acf-country

A country field for ACF.

12193.2k](/packages/hellonico-acf-country)[alleyinteractive/wp-asset-manager

Asset Manager is a toolkit for managing front-end assets and more tightly controlling where, when, and how they're loaded.

32343.0k2](/packages/alleyinteractive-wp-asset-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
