Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Created August 11, 2016 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/9492fcd44f135b10e92bc59e0958431c to your computer and use it in GitHub Desktop.
Save mgibbs189/9492fcd44f135b10e92bc59e0958431c to your computer and use it in GitHub Desktop.
FacetWP - show distance within Listify's result boxes
<?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' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment