FacetWP – show distance within Listify’s result boxes

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php
// the opening PHP tag (above) usually not needed

function fwp_show_distance() {
global $post;
$distance = facetwp_get_distance();
$distance = ( false !== $distance ) ? round( $distance, 2 ) . ‘ miles’ : ”;
echo ‘<div class=”fwp-distance”>’ . $distance . ‘</div>’;
}
add_action( ‘listify_content_job_listing_meta’, ‘fwp_show_distance’, 12 );
add_filter( ‘facetwp_proximity_store_distance’, ‘__return_true’ );
{{/gist}}