Created
August 11, 2016 12:20
-
-
Save mgibbs189/9492fcd44f135b10e92bc59e0958431c to your computer and use it in GitHub Desktop.
FacetWP - show distance within Listify's result boxes
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 | |
// 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