  In this paper, we prove that for fixed $k\geq 1$, the Wilker type inequality
{equation*} \frac{2}{k+2}(\frac{\sin x}{x}) ^{kp}+\frac{k}{k+2}(\frac{% \tan
x}{x})^{p}>1 {equation*}% holds for $x\in (0,\pi /2) $ if and only if $p>0$ or
$p\leq -% \frac{\ln (k+2) -\ln 2}{k(\ln \pi -\ln 2)}$. It is reversed if and
only if $-\frac{12}{5(k+2)}\leq p<0$. Its hyperbolic version holds for $x\in
(0,\infty) $ if and only if $% p>0$ or $p\leq -\frac{12}{5(k+2)}$. And, for
fixed $k<-2$, the hyperbolic version is reversed if and only if $p<0$ or $p\geq
-\frac{12}{% 5(k+2)}$. Our results unify and generalize some known ones.
