Created
March 7, 2014 13:15
-
-
Save illucent/9411279 to your computer and use it in GitHub Desktop.
array merge
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
| photos_query = new WP_Query( $photos ); | |
| $quotes_query = new WP_Query( $quotes ); | |
| $result = new WP_Query(); | |
| // start putting the contents in the new object | |
| $result->posts = array_merge( $photos_query->posts, $quotes_query->posts ); | |
| // here you might wanna apply some sort of sorting on $result->posts | |
| // we also need to set post count correctly so as to enable the looping | |
| $result->post_count = count( $result->posts ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment