How to prove that entropy is a state function?
I don't understand what you mean by saying "if you don't make the substitution you do not get zero".  The relevant point is that, for ideal gases, $$p = nRT/V,$$ so $p/T$ is constant with respect to $T$.  Therefore $$\frac \partial{\partial T}\left(\frac pT\right)=0$$ for an ideal gas, whether or not you use the substitution to simplify the process.

If you don't use the substitution, you need to use the quotient rule to do the partial derivative properly, and you should still end up getting zero if you do it correctly.  Could that be where your confusion is coming from?