[php]
$country = get_query_var(‘country’);
global $wpdb;
$result = $wpdb->get_row( “SELECT * FROM countries WHERE slug = ‘”.$country.”‘”);
$countyName = $result->name;
$countryCode = $result->code;
echo ‘<h2 style=”text-align: left” class=”vc_custom_heading title-common”>Latest travel advice for ‘.$countyName.’:</h2>’;
$url = “https://fftapi.scot.nhs.uk/1/get/$countryCode”;
$args = array(
‘headers’ => array(
‘Authorization’ => ‘Basic ‘ . base64_encode(gpservice . ‘:’ . fftServ1c3)
)
);
$response = wp_remote_get( $url, $args );
$body = wp_remote_retrieve_body( $response );
$data = json_decode($body);
echo ‘<p>’.$data->Description.'</p>’;
echo $data->GeneralInformation;
echo $data->ExtraContent;
echo $data->YellowFever;
[/php]