In the meanwhile I added new icons and meta data but only the icon of the distance of the sea should be invisible if the “function_number” value is not set
<?php echo "ID: ",get_the_ID(), "<img src='/wp-content/uploads/2023/06/icona_mare.jpg'/>", get_post_meta( get_the_ID(), "function_number",true )," m. ","<img src='/wp-content/uploads/2023/06/ospiti3.jpg'/>",get_post_meta( get_the_ID(), "tax_input[numero_ospiti]",true ), "<img src='/wp-content/uploads/2023/06/camere.jpg'/>",get_post_meta( get_the_ID(), "tax_input[numero_camere]",true ),colormag_entry_meta(); ?>
I tryed to use
$meta = get_post_meta( get_the_ID(), "function_number",true );
if ( ! empty( $meta )) {
echo "ID: ",get_the_ID(), "<img src='/wp-content/uploads/2023/06/icona_mare.jpg'/>", $meta," m.","<img src='/wp-content/uploads/2023/06/ospiti3.jpg'/>",get_post_meta( get_the_ID(), "tax_input[numero_ospiti]",true ), "<img src='/wp-content/uploads/2023/06/camere.jpg'/>",get_post_meta( get_the_ID(), "tax_input[numero_camere]",true ) ,colormag_entry_meta();
}
according the advice of bcworkz but in case the “function_number” value is not set all the other icons and meta values disappear, so I cant mix the 2 different behaviours ??
-
This reply was modified 1 year, 9 months ago by
sacconi.