Skip to content

A small WordPress plugin to select an image from your "Media Library", to be displayed as your post thumbnail, when no post thumbnail has been specified.

Notifications You must be signed in to change notification settings

mattyza/default-wordpress-post-thumbnail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Default WordPress Post Thumbnail

A small WordPress plugin to select an image from your "Media Library", to be displayed as your post thumbnail, when no post thumbnail has been specified.

Usage

This plugin adds two settings to the "Settings > Media" screen on your WordPress installation: one to select which image in your "Media Library" is to be the default image, and another to specify whether or not to run the filter inside the WordPress admin (the filter runs on the frontend by default).

To make use of the plugin requires no code modifications to your theme. The plugin filters when the the_post_thumbnail() template tag is called, displaying your default image instead, if no post thumbnail has been specified.

Changelog

2025-10-30 - 2.0.0

  • Restructured the code to use a namespace and simple function names.
  • Removed the now redundant "enable in WP Admin" checkbox setting.
  • Adjusted how the default image is selected to use a more modern approach with the media library and avoid a scalability issue with a large database query.
  • Introduces caching of the actual image based on attributes and size, to avoid repeated database queries and image generation.

2012-07-07 - 1.0.0

  • First release!

About

A small WordPress plugin to select an image from your "Media Library", to be displayed as your post thumbnail, when no post thumbnail has been specified.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published