Printing temperature value and control LED on browser

I had successfully control LED on browser, with the IP address, and print temperature value. But when I want to combine two sketches, it failed to connect to the ip address. The sketch has no error when compiling and uploading. The serial monitor only shows ‘Attempting to connect to…’.
I’m using the arduino uno, wifishield and LM35.

#include <SPI.h>
#include <WiFi.h>


char ssid[] = "TDDY";      // your network SSID (name) 
char pass[] = "12345678";   // your network password
int keyIndex = 0;                 // your network key Index number (needed only for WEP)

int status = WL_IDLE_STATUS;

WiFiServer server(80);

void setup() {


     Serial.begin(9600); 
  pinMode(9, OUTPUT);   // set the LED pin mode
  pinMode(8, OUTPUT);
 
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    while (true);       // don't continue
  }
  

  while ( status != WL_CONNECTED) { 
    Serial.print("Attempting to connect to SSID: ");
    Serial.println(ssid);
   
    status = WiFi.begin(ssid, pass);

   
    delay(10000);
  } 
  server.begin();
 
 
}

 
void loop() {
 
 WiFiClient client = server.available();
  if (client) {
    Serial.println("new client");
       String currentLine = "";
  
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
      
        if (c == '\n' && currentLineIsBlank) {
        
          client.println("HTTP/1.1 200 OK");
        
         {
            int tempPin = 1;
            float tempC;
            tempC = analogRead(tempPin);
            tempC = (5.0 * tempC * 100.0)/1024.0; 
            int sensorReading = tempC;
            client.print("temperature ");

            client.print(" is ");
            client.print(sensorReading);
            client.println("C");       
          }
          client.println("</html>");
           break;
        }
        if (c == '\n') {
         
         
          currentLineIsBlank = true;
        } 
        else if (c != '\r') {

        }
      
        
          currentLineIsBlank = false;
        }
     
          
             }
    }

    delay(1);


    
 
  }




void printWifiStatus() {

  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());


  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  
  


}
void led_loop() {
  WiFiClient client = server.available();   // listen for incoming clients
  if (client) {                             // if you get a client,
   Serial.println("new client");           // print a message out the serial port
    String currentLine = "";                // make a String to hold incoming data from the client
    while (client.connected()) {            // loop while the client's connected
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out the serial monitor
        if (c == '\n') {                    // if the byte is a newline character
    
          if (currentLine.length() == 0) {
           client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();
           
            client.print("Click <a href=\"/H9\">here</a> turn the LED on pin 9 on
");
            client.print("Click <a href=\"/L9\">here</a> turn the LED on pin 9 off
");
            client.print("Click <a href=\"/H8\">here</a> turn the LED on pin 8 on
");
            client.print("Click <a href=\"/L8\">here</a> turn the LED on pin 8 off
");
            
          client.println("</BODY>");
          client.println("</HTML>");
          
            client.println();
           
            break;
          }
          else {     
            currentLine = "";
          }
        }
        else if (c != '\r') {    
          currentLine += c;     
        }
     
        if (currentLine.endsWith("GET /H9")) {
          digitalWrite(9, HIGH);               // GET /H turns the LED on
        }
        else if (currentLine.endsWith("GET /L9")) {
          digitalWrite(9, LOW);                // GET /L turns the LED off
        }
       
        if (currentLine.endsWith("GET /H8")) {
          digitalWrite(8, HIGH);               // GET /H turns the LED on
        }
        else if (currentLine.endsWith("GET /L8")) {
          digitalWrite(8, LOW);                // GET /L turns the LED off
        }
      }
    }
 
  }
}

Let's follow your code,

first we see this

int status = WL_IDLE_STATUS;

then we see this

while ( status != WL_CONNECTED) { 
    Serial.print("Attempting to connect to SSID: ");
    ...