a function-definition is not allowed here before '{' token

void serial_dump_ESP(){
char temp;
while(ESP8266.available())
{
temp = ESP8266.read();
delay(1);
}

}

{sigh} Post your code.
All of it.
In code tags.

The compiler told you EXACTLY where the problem is, but you chose not to share, AND to post in a section of the forum clearly marked

For problems with Arduino itself, NOT your project

That's a perfectly good function you have there. So it's only the rest of your code that's the problem. Shame you haven't posted it really.

Steve