Last active
August 7, 2018 15:41
-
-
Save levnhub/22a61f10af643421a691f7d785cddeb6 to your computer and use it in GitHub Desktop.
PHP Snippets
This file contains hidden or 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 | |
| // Get phone number from ACF & clean for the link | |
| $phone_number = get_field( 'tel', 33 ); | |
| $clean_number = str_replace( array(' ', '-', '(', ')'), '', $phone_number ); | |
| ?> | |
| <a href="tel:<?php echo $clean_number ?>" class="header-menu-tel-link"><?php echo $phone_number ?></a> | |
| <!-- IF --> | |
| <?php | |
| if ( !empty($var) ) { | |
| $var2 = 'one'; | |
| } else { | |
| $var2 = ''; | |
| }; | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment