Stars: 105
Forks: 32
Pull Requests: 35
Issues: 56
Watchers: 9
Last Updated: 2022-09-02 07:33:42
[WordPress Plugin] Dynamically adds multiple featured image (post thumbnail) functionality to posts, pages and custom post types. [850k+ downloads and 100k+ active installs]
License: GNU General Public License v2.0
Languages: Shell, CSS, PHP, JavaScript
This project is no longer actively maintained.
Dynamically adds multiple featured image (post thumbnail) functionality to posts, pages and custom post types.
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.
dynamic-featured-images
directory to the plugin directory (/wp-content/plugins/
) or install it from Plugins->Add New->Upload
Plugins
menu in WordPress.Screen Options
in the upper right corner of your wordpress admin and make sure that the Featured Image 2
box is selected.bower install dynamic-featured-image
add
or edit
page of posts or pages and you will notice a box for second featured image.Set featured image
icon, select required image from the "Dynamic Featured Image Media Selector" popup and click Set Featured Image
.Add New
to add new featured image or use Remove
link to remove the featured image box.publish
or update
to save featured images.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');
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');
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');
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.
$ composer install
$ ./bin/install-wp-tests.sh <test-db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]
$ ./vendor/bin/phpunit
$ phpcs <dfi-plugin-dir or filename>
Please feel free to report any bug found. Pull requests, issues, and plugin recommendations are more than welcome!