Support

Account

Home Forums General Issues Getting relationship field values into selectbox Reply To: Getting relationship field values into selectbox

  • this plugin can be only 2 option for get list:

    – get from a repeater field created in option page (ACF Pro)
    – get from a post (single post ID)

    i read again your problem, this field doesn’t for you.

    you can create a small query like relationship field and then create you select list. something like this:

    <?php $args = array(
    	'posts_per_page'   => 5,
    	'offset'           => 0,
    	'category'         => '',
    	'orderby'          => 'post_date',
    	'order'            => 'DESC',
    	'include'          => '',
    	'exclude'          => '',
    	'meta_key'         => '',
    	'meta_value'       => '',
    	'post_type'        => 'post',
    	'post_mime_type'   => '',
    	'post_parent'      => '',
    	'post_status'      => 'publish',
    	'suppress_filters' => true ); ?>
        
    <?php $posts_array = get_posts( $args ); ?>
    
    <select>
    <?php foreach ( $dynamicposts as $post ) : setup_postdata( $post ); ?>
      <option value="<?php echo get_permalink(); ?>"><?php echo get_permalink(); ?></option>
    <?php endforeach; ?>
    </select>
    
    <?php wp_reset_postdata(); ?>