Related fields in a form
-
I am creating a form and in the related field
"fotografias_de"
the list is shown in alphabetical order without searching or reordering. Do I need to load some kind of libraries to make it look like List view (with reordering) form or take advantage of one that is already there?thanks
<!-- "fotografias_de" related custom field --> <label for="otros-fotografos">Otros Fotógrafos:</label> <?php $fotgrafo_args = array( 'post_type' => 'fotgrafo', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC', ); $fotgrafo_query = new WP_Query( $fotgrafo_args ); if ( $fotgrafo_query->have_posts() ) : ?> <select id="otros-fotografos" name="otros-fotografos[]" multiple > <?php while ( $fotgrafo_query->have_posts() ) : $fotgrafo_query->the_post(); ?> <option value="<?php the_ID(); ?>"><?php the_title(); ?></option> <?php endwhile; ?> </select> <?php wp_reset_postdata(); endif; ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Related fields in a form’ is closed to new replies.