2017 © Pedro Peláez
 

library dynamic-featured-image

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

image

ankitpokhrel/dynamic-featured-image

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

  • Thursday, March 15, 2018
  • by ankitpokhrel
  • Repository
  • 7 Watchers
  • 82 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 29 Forks
  • 3 Open issues
  • 20 Versions
  • 0 % Grown

The README.md

Latest Stable Version WordPress WordPress Rating License, (*1)

This project is no longer actively maintained., (*2)

Download Build Code Coverage, (*3)

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

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., (*5)

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 install dynamic-featured-image

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., (*6)

    New featured image box, (*7)

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

    Dynamic Featured Image Media Selector, (*9)

  3. Click on Add New to add new featured image or use Remove link to remove the featured image box., (*10)

    Featured Images
    Featured Images, (*11)

  4. After adding featured images click publish or update to save featured images., (*12)

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

Documentation

Other Resources

List of Available Functions

  1. get_image_id( $image_url )
  2. get_image_thumb( $image_url, $size = "thumbnail" )
  3. get_image_url( $attachment_id, $size = "full" )
  4. get_post_attachment_ids( $post_id )
  5. is_attached( $attachment_id, $post_id )
  6. get_image_title( $image_url )
  7. get_image_title_by_id( $attachment_id )
  8. get_image_alt( $image_url )
  9. get_image_alt_by_id( $attachment_id )
  10. get_image_caption( $image_url )
  11. get_image_caption_by_id( $attachment_id )
  12. get_image_description( $image_url )
  13. get_image_description_by_id( $attachment_id )
  14. get_nth_featured_image( $position, $post_id )
  15. get_all_featured_images( $post_id )
  16. get_featured_images( $post_id )
  17. get_link_to_image( $attachment_id )

Allowing DFI only in specific post types

You can use dfi_post_types filter to allow DFI only in a specific post types., (*13)

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

Blocking DFI

Use dfi_post_type_user_filter filter to block DFI from post types., (*14)

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

Use dfi_set_metabox_title filter to change the metabox default title (Featured Image), (*15)

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

Translation Guidelines

All translations live in the languages folder., (*16)

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.podynamic-featured-image for the plugin itself, ne for the language and NP for the country., (*17)

Development

  1. Install PHPUnit and composer if you haven't already.
  2. Install required dependencies shell $ composer install
  3. Build test using installation script shell $ ./bin/install-wp-tests.sh <test-db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]
  4. Run tests with phpunit shell $ ./vendor/bin/phpunit
  5. Validate changes against WordPress Coding Standards shell $ phpcs <dfi-plugin-dir or filename>

Questions about this project?

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

The Versions

15/03 2018

dev-master

9999999-dev

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

  Sources   Download

GPL2

The Requires

 

The Development Requires

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

04/02 2018

v3.6.5

3.6.5.0

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

  Sources   Download

GPL2

The Development Requires

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

03/01 2018

dev-php7

dev-php7

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

  Sources   Download

GPL2

The Development Requires

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

15/08 2017

v3.6.1

3.6.1.0

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

  Sources   Download

GPL2

The Development Requires

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

13/08 2017

v3.6.0

3.6.0.0

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

  Sources   Download

GPL2

The Development Requires

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

09/03 2016

v3.5.2

3.5.2.0

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

  Sources   Download

GPL2

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

08/07 2015

dev-dev

dev-dev

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

  Sources   Download

GPL2

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

08/07 2015

v3.5.1

3.5.1.0

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

  Sources   Download

GPL2

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

11/04 2015

v3.5.0

3.5.0.0

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

  Sources   Download

GPL2

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

07/03 2015

v3.4.0

3.4.0.0

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

  Sources   Download

GPL2

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

14/02 2015

v3.3.1

3.3.1.0

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

  Sources   Download

GPL2

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

21/11 2014

v3.3.0

3.3.0.0

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

  Sources   Download

GPL2

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

14/09 2014

v3.1.13

3.1.13.0

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

  Sources   Download

GPL2

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

17/08 2014

v3.1.9

3.1.9.0

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

  Sources   Download

GPL2

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

03/08 2014

v3.1.7

3.1.7.0

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

  Sources   Download

GPL2

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

12/07 2014

3.1.2

3.1.2.0

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

  Sources   Download

GPL2

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

09/05 2014

v3.1.0

3.1.0.0

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

  Sources   Download

GPL2

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

07/03 2014

v3.0.1

3.0.1.0

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

  Sources   Download

GPL2

The Requires

  • wordpress/wordpress >=3.3.0

 

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

20/02 2014

v3.0.0

3.0.0.0

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

  Sources   Download

GPL2

The Requires

  • wordpress/wordpress >=3.3.0

 

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails

14/02 2014

v2.0.2

2.0.2.0

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

  Sources   Download

GPL2

The Requires

  • wordpress >=3.3.0

 

wordpress plugin dynamic featured image multiple featured image multiple post thumbnails