If there can be more than one outcome in a custom field, how do I echo them?
I have the following code:
add_action( 'wpsp_after_title', function() {
$meta = get_post_meta( get_the_ID(), 'geodir_dining_options', true );
if ( $meta ) {
echo do_shortcode( '[gd_post_badge key="dining_options" condition="is_equal" search="Dine-In" badge="Dine-In" bg_color="#1ca800" txt_color="#ffffff"]' );
echo do_shortcode( '[gd_post_badge key="dining_options" condition="is_equal" search="Take-Away" badge="Take-Away" bg_color="#7ccc66" txt_color="#000000"]' );
echo do_shortcode( '[gd_post_badge key="dining_options" condition="is_equal" search="Delivery" badge="Delivery" bg_color="#000000" txt_color="#ffffff"]' );
}
} );
If there is only one outcome (i.e. dine-in only), there is output. But if there are two or more (dine-in, take-away, delivery), nothing is outputted.