Query Custom Posts – Add To Selection
Use wp_reset_postdata(); to restore the global $post variable of the main query loop after a secondary query loop using new WP_Query. It restores the $post variable to the current post in the main query. call wp_reset_postdata(); after endwhile; <?php while($org->have_posts()) : $org->the_post(); ?> <option value=”<?php echo $post->post_name; ?>”><?php the_title(); ?></option> <?php endwhile; // reset main … Read more