Created
March 20, 2024 16:30
-
-
Save nfsarmento/0837075ab6d291cb1cb08d1e81cd78d7 to your computer and use it in GitHub Desktop.
Default/fallback post thumbnail image.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Default/fallback post thumbnail image. | |
* | |
*/ | |
function aoa_filter_thumbnail_id( $thumbnail_id, $post = null ) { | |
if ( ! $thumbnail_id ) { | |
$thumbnail_id = 16157; //id of default featured image | |
} | |
return $thumbnail_id; | |
} | |
add_filter( 'post_thumbnail_id', 'aoa_filter_thumbnail_id', 20, 5 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment