How can I loop my code? For example after 30 minutes?
You execute the corresponding function only in the setup() function, which is called once on startup of the ESP. After that the loop() function is called repeatedly. The setup() function is meant to "setup" your code for it's functionality, which is then executed in the loop() function. For example you are begin the Wifi connection and connect to a network in there, because you need the network for your main functionality.

So you have to put the code from readSensor() until (and including) sendDataToServer() into the loop() function. This will execute this code repeatedly.

Then you have to introduce some concept of time, else your code will be executed very fast, effectively flooding your webserver. The easiest way would be to add a call to delay(30000), which would delay the code for 30s. But using delay is not considered good coding style, since it is basically busy waiting and you cannot do anything else during that time.

So to be able to add other functionalities in the future you can implement the time concept with non-blocking code. Take the BlinkWithoutDelay example from the Arduino IDE as reference. It uses the millis() function, which counts the milliseconds since the startup. You save a timestamp of the last execution of your code and wait until the difference between the current time (given by millis()) and your timestamp is greater than 30s. In this time the ESP can do other things, since it still goes through the loop() function undisrupted. Then after the timespan you execute the code and reset the timestamp to the current time.