05 Cranks but won't start

I have a 05 Nissan Altima S 2.5L. My check engine light is on and reading code P0302. I have all new spark plugs and coil packs and a new fuel pump. My cars will sit for days without starting then all of a sudden start up. It can be driven without the car cutting off. Once the car is turned off it's back to the same thing. Cranks but wont start.

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 2
crwdns2934285:0crwdne2934285:0