First off, as I mentioned in the comment, you got a syntax error here, where there’s an unwanted }
:
$meta = get_post_meta( $post->ID, 'clpr_coupon_code', true );} // <- that }
(Updated answer — Previous code were removed since they didn’t work for you.)
So if you want to show the special text when $clpr_options->coupon_code_hide
does not evaluate to a true
and that the field clpr_coupon_code
is empty; try this:
<?php if ( $clpr_options->coupon_code_hide ) {
$class .= ' coupon-hidden';
$meta = get_post_meta( $post->ID, 'clpr_coupon_code', true );
// If clpr_coupon_code is empty.
if ( ! $meta ) {
$button_text="Angebot anzeigen";
// If clpr_coupon_code is not empty.
} else {
$button_text = fl_get_option( 'fl_lbl_show_coupon' );
$button_text="<i class="icon-lock"></i>" . $button_text;
}
}
?>