The

conjugacy class equation says,

$\displaystyle |G| = |\text{Z}(G)| + \sum [G:\text{C}(x)]$.

Where the $\displaystyle x$'s are taken from distinct conjugacy classes of more than one element.

We know that the left hand side is divisible by $\displaystyle p$ so the right hand side is divisible by $\displaystyle p$. Now $\displaystyle \text{C}(x) $, the centralizer, is not whole $\displaystyle G$ because we are picking those $\displaystyle x$, this means $\displaystyle 1\leq |\text{C}(x)| \leq p^{n-1}$. This means $\displaystyle p$ divides the index of $\displaystyle \text{C}(x)$ under $\displaystyle G$. Thus, this proves that $\displaystyle \text{Z}(G)$ is divisible by $\displaystyle p$. Thus, the center is non-trivial.