diff --git a/templates/official-details.php b/templates/official-details.php
index 48be84c1..3837ce33 100644
--- a/templates/official-details.php
+++ b/templates/official-details.php
@@ -51,7 +51,7 @@ if ( $show_nationality ):
$values = array();
foreach ( $nationalities as $nationality ):
$country_name = sp_array_value( $countries, $nationality, null );
- $values[] = $country_name ? ( $show_nationality_flags ? '
' : '' ) . $country_name : '—';
+ $values[] = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '—';
endforeach;
$common[ __( 'Nationality', 'sportspress' ) ] = implode( '
', $values );
endif;
diff --git a/templates/player-details.php b/templates/player-details.php
index 3a2c742d..52028411 100644
--- a/templates/player-details.php
+++ b/templates/player-details.php
@@ -51,7 +51,7 @@ if ( $show_nationality ):
$values = array();
foreach ( $nationalities as $nationality ):
$country_name = sp_array_value( $countries, $nationality, null );
- $values[] = $country_name ? ( $show_nationality_flags ? '
' : '' ) . $country_name : '—';
+ $values[] = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) . $nationality . '"> ' : '' ) . $country_name : '—';
endforeach;
$common[ __( 'Nationality', 'sportspress' ) ] = implode( '
', $values );
endif;
diff --git a/templates/player-list.php b/templates/player-list.php
index bab8abd2..114e201c 100644
--- a/templates/player-list.php
+++ b/templates/player-list.php
@@ -179,7 +179,7 @@ foreach ( $groups as $group ):
$nationalities = $player->nationalities();
if ( ! empty( $nationalities ) ):
foreach ( $nationalities as $nationality ):
- $name = '
' . $name;
+ $name = '' . sp_flags( $nationality ) . '' . $name;
endforeach;
$name_class .= ' has-photo';
endif;
diff --git a/templates/staff-details.php b/templates/staff-details.php
index ce04eb61..9fca30a9 100644
--- a/templates/staff-details.php
+++ b/templates/staff-details.php
@@ -41,7 +41,7 @@ if ( $show_nationality && $nationalities && is_array( $nationalities ) ):
$nationality = sp_array_value( $legacy, $nationality, null );
endif;
$country_name = sp_array_value( $countries, $nationality, null );
- $values[] = $country_name ? ( $show_nationality_flags ? '
' : '' ) . $country_name : '—';
+ $values[] = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '—';
endforeach;
$data[ __( 'Nationality', 'sportspress' ) ] = implode( '
', $values );
endif;