Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CatEntangler/1e44bfdadaa4c198c6d25096542ecbd4 to your computer and use it in GitHub Desktop.
Save CatEntangler/1e44bfdadaa4c198c6d25096542ecbd4 to your computer and use it in GitHub Desktop.
Get the attached media to a post minus the featured image
function GetAttachedMediaMinusFeaturedImage( INT $postId ) {
$featuredImage = get_post_thumbnail_id( $postId );
$attached_media = get_attached_media( NULL, $postId );
unset( $attached_media[ $featuredImage ] );
return $attached_media;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment