Created
September 5, 2015 11:36
-
-
Save mikaelz/c58b507e20285a31d818 to your computer and use it in GitHub Desktop.
WordPress - get all post attachments excluding (without) the featured image. Codex page https://codex.wordpress.org/Template_Tags/get_posts
This file contains 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
$attachments = get_posts( array( | |
'post_type' => 'attachment', | |
'posts_per_page' => -1, | |
'post_status' => 'any', | |
'post_parent' => get_the_ID(), | |
'exclude' => get_post_thumbnail_id(), | |
) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment