Has GTS been shutdown for 4th and 5th generation?

Yep, all WiFi things (so inluding GTS) from 4th and 5th gen are removed. Official announcement by Nintendo said:

As of May 20, 2014, certain online functionality offered through Nintendo Wi-Fi Connection is no longer accessible. The discontinued services include online play, matchmaking and leaderboards for many Wii, Nintendo DS and Nintendo DSi games. For a comprehensive list of games and services that are affected, please check http://support.nintendo.com/servicesupdate. Users can still play the games in offline mode, which continues to offer a rich game-play experience.

In the list below with affected games there are the following Pokemon games:

  • Pokémon Black Version
  • Pokémon Black Version 2
  • Pokémon Diamond Version
  • Pokémon HeartGold Version
  • Pokémon Mystery Dungeon: Explorers of Darkness
  • Pokémon Mystery Dungeon: Explorers of Sky
  • Pokémon Mystery Dungeon: Explorers of Time
  • Pokémon Pearl Version
  • Pokémon Platinum Version
  • Pokémon Ranger: Guardian Signs
  • Pokémon Ranger: Shadows of Almia
  • Pokémon SoulSilver Version
  • Pokémon White Version
  • Pokémon White Version 2