The most common cause of heel pain is plantar fasciitis. Many patients with plantar fasciitis have a heel spur on the front and bottom of their heel, but heel spurs do not cause pain.
Top of the foot can cause pain if you have 1) inflammation of the foot as a whole or 2) tight fitting footwear and other that these causes the pain at the top of the foot and the plantar pain are not related.
Take pain killers, apply ice packs and follow up with a foot specialist for a proper diagnosis if the pain does not decrease.
The pain only lasts for seconds. This happens with or without shoes. I have been to a podiatrist, He said it might be a pinched nerve or a skin problem. I can go for weeks without feeling anything, then it will happen twenty times in a day. I just want to find a cause, Maybe it's my anxiety, but too often doctors use that for everything they can't explain.