Defaultify Featured Image

Description

Defaultify Featured Image allows WordPress site administrators to specify a default featured image that will be used when a post doesn’t have one. The plugin now includes an option to enable or disable the automatic application of default images.

Installation

  1. Upload the plugin files to the /wp-content/plugins/defaultify-featured-image directory, or install the plugin through the WordPress plugins screen directly
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Go to Settings > Media to select a default featured image
  4. Use the checkbox to enable or disable automatic application of the default image

FAQ

Where can I get support?

For plugin support, feature requests, or bug reports, please contact us at navneetkrkashyap@gmail.com. We typically respond within 24-48 hours during business days.

You can also:
* Search existing support topics in the WordPress.org support forum
* Report bugs or suggest features via email

When contacting support, please include:
* Your WordPress version
* Your theme name and version
* A detailed description of the issue
* Steps to reproduce the problem (if applicable)

My chosen featured image doesn’t show, why isn’t it working?

This plugin works out of the box for most cases, but not always. If it doesn’t work you can try the following things:

  • Make sure the “Automatically apply default image” checkbox is enabled
  • Switch themes. Some themes may handle featured images in non-standard ways
  • Ensure you’re using the Core WordPress functions to get the image
  • Check if normal featured images work on your site
  • The image might be hidden via CSS. Default images have an extra default-featured-img class added to them

Can I set a different image for a custom post type?

Yes, you can use the following code snippet:

`php

add_filter( ‘wpdfi_thumbnail_id’, ‘wpdfi_posttype_book’, 10, 2 );
function wpdfi_posttype_book( $wpdfi_id, $post_id ) {
$post = get_post( $post_id );
if ( ‘book’ === $post->post_type ) {
return 31; // the image id for the book post type
}
return $wpdfi_id; // the original featured image id
}
`

Can I set different images per category?

Yes, here’s how you can set different images based on categories:

`php

add_filter( ‘wpdfi_thumbnail_id’, ‘wpdfi_category’, 10, 2 );
function wpdfi_category( $wpdfi_id, $post_id ) {
// Set a different image for posts that have the ‘cats’ category
if ( has_category( ‘cats’, $post_id ) ) {
return 7; // cats image id
}
// Set a different image for posts that have the ‘dogs’ category
if ( has_category( ‘dogs’, $post_id ) ) {
return 8; // dogs image id
}
return $wpdfi_id; // the original featured image id
}
`

Can I change the HTML of the default featured image?

When a default featured image is used, an extra class default-featured-img is added automatically. If you need more customization, you can use the wpdfi_thumbnail_html filter:

`php

add_filter( ‘wpdfi_thumbnail_html’, ‘wpdfi_add_class’, 10, 5 );
function wpdfi_add_class( $html, $post_id, $default_thumbnail_id, $size, $attr ) {
// Add a class to the existing class list
$attr[‘class’] .= ‘ my-custom-class’;
return wp_get_attachment_image( $default_thumbnail_id, $size, false, $attr );
}
`

Can I exclude specific pages from having a default featured image?

Yes, here’s how to exclude a specific post or page:

`php

add_filter( ‘wpdfi_thumbnail_id’, ‘wpdfi_skip_page’, 10, 2 );
function wpdfi_skip_page( $wpdfi_id, $post_id ) {
if ( $post_id == 23 ) {
return 0; // invalid id – no image will be applied
}
return $wpdfi_id; // the original featured image id
}
`

How can I control when the default image is applied?

You can use the checkbox in the media settings page to enable or disable automatic application of the default image. When disabled, the default image will not be automatically applied to posts without a featured image.

Reviews

There are no reviews for this plugin.

ডেভেলপার এবং কন্ট্রিবিউটর

“Defaultify Featured Image” is open source software. The following people have contributed to this plugin.

কন্ট্রিবিউটর

Translate “Defaultify Featured Image” into your language.

ডেভেলপমেন্ট এ আগ্রহী?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.9.1

  • Fixed: Plugin name compliance for WordPress.org directory
  • Removed: Unnecessary load_plugin_textdomain() call for better WordPress 4.6+ compatibility
  • Updated: Plugin branding and documentation
  • Improved: Code structure and organization

1.9.0

  • Added: Option to enable/disable automatic application of default featured images
  • Added: New checkbox control in media settings for better user control
  • Improved: Filter hooks for developer customization
  • Fixed: Compatibility issues with WordPress 6.8

1.8.0

  • Added: Filter hook ‘wpdfi_thumbnail_html’ for advanced customization
  • Added: Support for responsive images and srcset attributes
  • Improved: Admin interface with better preview functionality
  • Updated: JavaScript for better media manager integration

1.7.0

  • Added: Bulk actions support for posts without featured images
  • Added: Integration with WordPress REST API
  • Improved: Admin UI with modern WordPress design patterns
  • Fixed: Compatibility issues with Gutenberg block editor

1.6.0

  • Added: Multiple default images based on post categories
  • Added: Advanced settings panel in WordPress customizer
  • Improved: Image processing and thumbnail generation
  • Fixed: Compatibility with WordPress multisite networks

1.5.0

  • Added: Conditional logic for displaying default images
  • Added: Integration with popular page builders
  • Improved: Admin user interface and experience
  • Fixed: Compatibility issues with caching plugins

1.3.0

  • Added: Multiple default images support
  • Added: Category-based default image selection
  • Improved: Plugin architecture and code structure
  • Updated: Admin interface redesign

1.2.0

  • Added: Advanced image management options
  • Added: Support for multiple image formats
  • Improved: User interface and admin experience
  • Fixed: Various compatibility and performance issues

1.0.0

  • Initial release
  • Basic default featured image functionality
  • Media library integration
  • Admin settings page
  • Support for posts and pages