Php 使用wordpress的简单字段插件显示多个图像/字段

Php 使用wordpress的简单字段插件显示多个图像/字段,php,wordpress,custom-fields,Php,Wordpress,Custom Fields,我正在使用wordpress的“简单字段”插件,并设置了一个字段来上传文件(在本例中是图像)。Im使用以下代码,允许我在前端显示特定的图像/字段: <?php $selected_value = simple_fields_get_post_value(get_the_id(), array(1, 1), true); $theImageURL = wp_get_attachment_url($selected_value); echo '<img src="'.$theIma

我正在使用wordpress的“简单字段”插件,并设置了一个字段来上传文件(在本例中是图像)。Im使用以下代码,允许我在前端显示特定的图像/字段:

<?php 

$selected_value = simple_fields_get_post_value(get_the_id(), array(1, 1), true); 
$theImageURL = wp_get_attachment_url($selected_value);
echo '<img src="'.$theImageURL.'">';

?>

显然,在本例中,它使用该字段的特定键:_simple_fields_fieldGroupID_1_fieldID_1_numInSet_0

如何在不必明确标识每个字段的情况下显示post连接器中的多个图像


就目前情况而言,如果我要在帖子中包含3张图片,所有人都会使用数组(1,1)。猜测id只需要创建一个包含所有相关图片的数组,我自己就知道了

<?php
    $field_group_values = simple_fields_fieldgroup("cs_slider");
    foreach ($field_group_values as $field_group_value) {
        $theImageURL = wp_get_attachment_url($field_group_value);
        echo '<img src="'.$theImageURL.'">'; 
    }
?>

cs_滑块是字段组的段塞