2D platformer jump though one way platform [Unity 5]

Hello there,

So I’m attempting to create a simple 2D platformer, so I had a look around on something known as the “internet” and I found some code that will allow my character to fall though a platform if that platform is on X layer.
However my problem is, if my character attempts to jump through that platform from below, view the image I have provided. He hits his head and falls back down, how can I solve this problem?

P.S. if you want to see any of my code just let me know and just to inform you I am just using a simple Box Collider 2D.

2063857--134523--HitHead.png

Are you using the Platform Effector on your platforms?