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 | |
$location = get_field('map_location'); | |
if ( !empty( $location ) ) : | |
$map_url = 'https://www.google.com/maps/dir/?api=1&destination=' . $location['lat'] . ',' . $location['lng']; | |
echo '<a href=". esc_url( $map_url ) . '" rel="nooopener">Get directions</a>'; | |
endif; | |
?> | |
<p>This should produce a link like this:</p> | |
<a href="https://www.google.com/maps/dir/?api=1&destination=51.072159,1.088130">Get directions</a> |
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
<img src="http://maps.google.com/maps/api/staticmap?center=<?php echo $location['lat']; ?>,<?php echo $location['lng']; ?>&markers=<?php echo $location['lat']; ?>,<?php echo $location['lng']; ?>&zoom=9&size=360x300&sensor=FALSE" /> | |
<div class="acf-map--mobile" style="background-image:url('http://maps.google.com/maps/api/staticmap?center=<?php echo $location['lat']; ?>,<?php echo $location['lng']; ?>&markers=<?php echo $location['lat']; ?>,<?php echo $location['lng']; ?>&zoom=9&size=360x300&sensor=FALSE');"></div> |
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 _e('Email us','roots'); ?>: <?php $tend_email = get_field('email_address', 'options'); ?><a href="mailto:<?php echo antispambot( $tend_email, 1 ); ?>"><?php echo antispambot( $tend_email, 0 ); ?></a> |
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
// Gravity forms UK Address. Stick it in your functions.php | |
function uk_address($address_types, $form_id) { | |
$address_types["uk"] = array( | |
"label" => "UK & Ireland", | |
"country" => "UK", | |
"zip_label" => "Postcode", | |
"state_label" => "County", | |
"states" => array("Aberdeenshire"=>"Aberdeenshire","Angus/Forfarshire"=>"Angus/Forfarshire","Argyllshire"=>"Argyllshire","Ayrshire"=>"Ayrshire","Banffshire"=>"Banffshire","Bedfordshire"=>"Bedfordshire","Berkshire"=>"Berkshire", | |
"Berwickshire"=>"Berwickshire","Blaenau Gwent"=>"Blaenau Gwent","Bridgend"=>"Bridgend","Buckinghamshire"=>"Buckinghamshire","Buteshire"=>"Buteshire","Caerphilly"=>"Caerphilly","Caithness"=>"Caithness", |
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 | |
$args = array( | |
'post_parent' => $post->ID, | |
'post_type' => 'page', | |
'orderby' => 'menu_order' | |
); | |
$child_query = new WP_Query( $args ); | |
?> |
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
// Don't use get_archives. It's deprecated. | |
<?php wp_get_archives( array( 'type' => 'postbypost', 'limit' => 5 ) ); ?> |
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 | |
$image_src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 5600,1000 ), false, '' ); | |
?> | |
<div class="post-thumbnail" style="background-image: url('<?php echo $image_src[0]; ?>');"> |
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 $parent_id = $post->post_parent; ?> | |
<?php the_field('custom_field', $parent_id); ?> |
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
// http://www.advancedcustomfields.com/resources/how-to-get-values-from-a-taxonomy-term/ | |
<?php | |
// vars | |
$queried_object = get_queried_object(); | |
$taxonomy = $queried_object->taxonomy; | |
$term_id = $queried_object->term_id; | |
?> | |
<?php the_field('show_usp_strip', $queried_object); ?> |