Truck Only Starts When Cold

I have a 2003 Ford Ranger that only starts when it’s cold. If I drive it for a bit so that it warms up, stop the engine, and then try to start it again, it will just continue to turn over. Once it cools down, it’ll start again. To make matters worse, now that the weather is getting warmer, it may or may not start depending on the time of day. Yesterday afternoon, about 70 degrees, no dice. This morning at about 50 degrees, started right up. When it won’t start, it’s as if it’s getting no fuel. The battery seems fine, and it’s trying and trying to turn over, but no.