in Snippets, Tutorials, WordPress

Exclude Featured Image From Gallery Shortcode

I came across this great snippet after some extensive searching and just wanted to share it to avoid others having to search long and hard just to find it. Authored by TheDeadMedic over on Stack Overflow, inserting the following into your functions.php file will exclude the_post_thumbnail or featured image of a post from its gallery:

Write a Comment

Comment