For the record, client.connect does not “ping”. It opens a connection. But it does so to the IP adres on port 80 of the router. So that implies to the HTML server on the router. “Pinging” is done with the ICMP protocol, and needs other functions/libraries. Even then, the router may or is likely configured to ignore ping requests.
// if you get a connection, report back via serial:
if (client.connect(ping,80)) {
client.connect returns a number which indicates if it succeeded or what the reason was of failing. So storing that value into a variable (of type int should work) and printing that to the LCD or serial port to the PC would explain more about the cause of failing.