My While loop is breaking the rest of my PHP on the site. Below I put my code that is working but again breaking the rest of the site. Any Suggestions
$query = array( 'post_type' => 'slides', 'orderby' => 'ASC' );
$loop = new WP_Query($query);
while ( $loop->have_posts() ) : $loop->the_post();
$title = get_the_title();
$image_object = get_field('slides');
$alt = $image_object['title'];
$sizes = $image_object['sizes'];
$image = $sizes['slider'];
echo '<div>';
echo '<div class="slide">';
echo '<img src="' . $image . '" alt="' . $alt . '" />';
echo '</div>';
echo '</div>';
endwhile;
ASC
is not a validorderby
argument, it's'order' => 'ASC'
– Milo Jan 15 '13 at 18:10