Bigsky Creative | Marketing Company in Creston, BC

				
					// The custom WordPress query to retrieve the data for the radius and the locations custom fields.
$query = new WP_Query( array(
  'post_type' => 'page',
  'p' => $post_id,
  'meta_key' => array( 'radius', 'locations' )
) );

// Loop through the posts in the query and display each location.
while ( $query->have_posts() ) {
  $query->the_post();

  // Get the radius and the locations from the custom fields.
  $radius = get_post_meta( get_the_ID(), 'radius', true );
  $locations = get_post_meta( get_the_ID(), 'locations', true );

  // Loop through the locations and display each one on the page.
  foreach ( $locations as $location ) {
    echo '<h2>' . $location['name'] . '</h2>';
    echo '<p>' . $location['address'] . '</p>';
    echo '<p>Radius: ' . $radius . '</p>';
    // Add other information about the location here...
  }
}