echo multiple $selected_value

I’m sure this query is a straightforward one, but I couldn’t seem to find an exact answer on the forum here.

I’m using the Simple Fields plugin for WordPress, and just want to display all the answers from a particular field. This code below only displays the most recent entry:

Read More
<?php $selected_value = simple_fields_get_post_value(get_the_id(), array(2, 2), true);
echo "$selected_value";
?>

I’ve tried the suggestions on the Simple Fields tutorial/documentation pages, but they seem to give me the same result – just the most recent entry, and not all the entries.

Thanks.

Related posts

Leave a Reply

2 comments

  1. Here is how you can use ‘simple_fields_get_post_value’:

    $selected_value = simple_fields_get_post_value(get_the_id(), 
                                                   "Your Image Field Name", true); 
    
    $theImageURL = wp_get_attachment_url($selected_value);
    
    echo '<img src="'.$theImageURL.'">';