mohit131 Posted August 9, 2017 Share Posted August 9, 2017 I'm trying to display distance on my posts using facetwp plugin in my listify theme. CODE https://facetwp.com/proximity-facet-show-post-distance/ https://gist.github.com/mgibbs189/9492fcd44f135b10e92bc59e0958431c Listify format for using hooks ver 2.x http://listify.astoundify.com/article/545-add-additional-information-to-the-listing-grid I tried this code in my function.php but getting no result. add_filter( 'listify_get_listing_to_array', function( $data, $listing ) { $distance = facetwp_get_distance(); if ( '' !== $distance ) { $data['distance'] = $distance; } return $data; }, 10, 2 ); add_action( 'listify_content_job_listing_meta', function() { // Check if available. echo '<# if ( data.distance ) { #>'; echo '<div class="fwp-distance">{{data.distance}}</div>'; echo '<# } #>'; } ); add_filter( 'facetwp_proximity_store_distance', '__return_true' ); Any suggestions will be highly appreciated Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted August 9, 2017 Share Posted August 9, 2017 EDIT: I changed the topic title; it was "PHP expert please Help!" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.