Closed cibulka closed 11 years ago
Okay, as pointed out by zach - http://www.farinspace.com/forums/topic/have_fields-conditional-weirdness/ - there is some bizarre behaviour of have_fields function under conditionals.
If you use $meta method, everything works just fine. Here's my updated code:
$meta = $mb_general->the_meta();
if ($meta['friends']) {
echo'<section id="friends"><h4>Friends</h4><ul>';
foreach($meta['friends'] as $friend) {
$url = $friend['friends_url'];
echo'<li>'.$url.'</li>';
}
echo'</ul></section>';
}
This works!
Hello everyone,
first of all, I want to point out that i see WPAlchemy as the ultimate solution for most of the post meta situation you can run into on building the Worpdress website! I especially love the architecture that allows very advanced customization.
Back to my issue: One thing I can't crack is how to ask if repeatable fields exist without breaking the index. If I have 4 fields in the group, this code -
Is there any safe way to check if the fields exist? On Farin's website, I can't seem to find anything of the sort.
Thank you! Petr