Quick explanation : When I add a new "Company" (custom post type), I have a drop down menu listing all the companies to choose if the one i'm creating depends from another one. I got 3 metaboxes, the dropdown is in the first one.
In functions.php : <select value="<?php echo $subsidiary; ?>" name="subsidiary"> <?php $args = array( 'post_type' => 'company'); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <option value="<?php echo the_ID(); ?>" ><?php the_title() ?></option> <?php endwhile; ?> </select>
The dropdown is listing all the companies as i want, but when i create a new company, all fields located after my dropdown take the values from the first company in my list, and i can't change them. Any clues?
Thanks in advance.