Created
August 26, 2015 20:58
-
-
Save taniarascia/46206dc09f47146771e2 to your computer and use it in GitHub Desktop.
Pull without query_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
$args = array( | |
'post_type' => 'post-custom', | |
'order' => 'ASC', | |
'posts_per_page' => -1, | |
'fields' => 'ids' | |
); | |
$post_ids = get_posts( $args ); | |
foreach ( $post_ids as $id ) { | |
$meta = get_post_meta( $id, '_my_meta', true ); | |
echo '<img src="' . $meta['img'] . '">'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment