Created
February 8, 2012 03:05
-
-
Save zamoose/1764801 to your computer and use it in GitHub Desktop.
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
<?php | |
// Set up arrays to hold the post objects | |
$rotator_items = $testimonial_items = array(); | |
// Loop through rotator items | |
$rotator_args = array( 'post_type' => 'rotator' ); | |
$rotator = new WP_Query( $rotator_args ); | |
$c1 = 0; | |
while( $rotator->have_posts() ): $rotator->the_post(); | |
$rotator_items[$c1] = get_the_post_thumbnail($rotator->get_the_ID()); | |
$c1++; | |
endwhile; | |
// Loop through Testimonial items | |
$testimonial_args = array( | |
'post_type' => 'testimonial', | |
'posts_per_page' => $count, | |
); | |
$testimonial = new WP_Query($testimonial_args); | |
$c2 = 0; | |
while( $testimonial->have_posts() ): $testimonial->the_post(); | |
$return .= '<div>' . get_the_post_thumbnail($testimonial->get_the_ID()) . '</div>'; | |
$return .= '<div>' . $rotator_items[$c2] . '</div>'; | |
$c2++; | |
endwhile; | |
return $return; | |
// Reset the Query | |
wp_reset_query(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment