Created
April 7, 2017 00:43
-
-
Save guilhermealveslopes/bb1525974e994c5c248a25a7306e3883 to your computer and use it in GitHub Desktop.
If variable is null display X, else. display X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $meta = get_post_meta( $post->ID, 'meta', true); <--! define o valor da variável --> | |
if (!empty($telefone)) { ?> <--! Confere se está vazia ou não --> | |
Resultado caso não seja nula. | |
<?php } else { ?> | |
Resultado caso seja nula. | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment