I thought of a while loop but cant find the way around this:
$foo1 = get_post_meta( $post->ID, '_item1', true );
if (!empty($foo1)){
echo ("<div class='$foo1'></div>");
}
$foo2 = get_post_meta( $post->ID, '_item2', true );
if (!empty($foo2)){
echo ("<div class='$foo2'></div>");
}
And so on... for a hundred times until I reach $foo100 and _item100 Any idea to achieve this to not repeat these 4 lines over and over?