Created
May 18, 2013 18:18
-
-
Save ericmann/5605333 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
$post_ids = array( 1, 2, 3, 4 ); | |
foreach ( $post_ids as $post_id ) { | |
$post = get_post( $post_id ); | |
if ( null === $post ) { | |
continue; | |
} | |
setup_postdata( $post ); | |
// ... do stuff with this post | |
wp_reset_postdata(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment