我不知所措。我有一个带有Jan创建的“multicheck”代码的自定义元框。它工作得很好。我现在的问题是如何正确返回数据。
场景:有5个可能的值,每个值都具有相同的meta\\u键。我试图做的是,如果使用5个可能值中的一个存储值,则显示特定内容。所发生的是内容在重复。
当前站点:http://dev.andrewnorcross.com/yoga/locations/tampa/
当前代码:
<?php
global $post;
$offerings = get_post_meta($post->ID, "evol_offerings_select", false);
if ($offerings[0]=="") { ?>
<!-- If there are no custom fields, show nothing -->
<?php } else { ?>
<div class="offerings">
<h3>offerings:</h3>
<?php
foreach ($offerings as $offering) {
if ($offering["hot"]==true) {
echo "<div class=\'single_offering\'>";
echo "<h3>Hot 90</h3>";
echo "<p class=\'class_info\'>temp: 105° time: 90 min</p>";
echo \'</div>\';
}
if ($offering["flow"]==true) {
echo "<div class=\'single_offering\'>";
echo "<h3>Flow 75</h3>";
echo "<p class=\'class_info\'>temp: 80° time: 75 min</p>";
echo \'</div>\';
}
if ($offering["warm"]==true) {
echo "<div class=\'single_offering\'>";
echo "<h3>Warm 60</h3>";
echo "<p class=\'class_info\'>temp: 90° time: 60 min</p>";
echo \'</div>\';
}
if ($offering["chill"]==true) {
echo "<div class=\'single_offering\'>";
echo "<h3>Chill 30</h3>";
echo "<p class=\'class_info\'>temp: 75-80° time: 30 min</p>";
echo \'</div>\';
}
if ($offering["kids"]==true) {
echo "<div class=\'single_offering\'>";
echo "<h3>Kids Class</h3>";
echo "<p class=\'class_info\'>temp: comfy time: 60 min</p>";
echo \'</div>\';
}
} ?>