Is there a way to prevent the featured image from even showing up in a post's gallery?
e.g. when editing the gallery in the admin for a post, the featured image isn't there.
|
Is there a way to prevent the featured image from even showing up in a post's gallery? e.g. when editing the gallery in the admin for a post, the featured image isn't there. |
|||||||
|
|
Okay, I had the same problem and just solved it by adding an "exclude" field to the shortcode. Like so...
You have to just pull the ID number of the file you don't want to show. This works without adding any functions or edits to the theme. |
|||
|
|
|
If you use the If you want to do it dynamically I suggest using the
not tested but should work. |
|||||
|
|
I am agree with @janw's answer. I would like to add further as: You can edit your single template to automatically show the gallery without needing to insert the gallery shortcode manually. Open your single.php file and inside the loop, where you want the gallery to be displayed, copy this line of code:
|
|||
|
|