If the state function Enthalpy $H$ is defined by $$H=U+PV\tag{1}$$ where $U$ is the internal energy of the system, $P$ is the systems pressure and $V$ is its volume.
It follows that $$dH=TdS + VdP\tag{2}$$ by use of the product rule and the first law of thermodynamics: $$dU=TdS - PdV\tag{3}$$ where $T$ is the thermodynamic (absolute) temperature and $S$ is the entropy of the system defined by $$dS=\frac{\delta Q_R}{T}\tag{4}$$ where $Q_R$ is the heat energy supplied to a reversible thermodynamic process.
One way of describing enthalpy is to say that the change in enthalpy is the heat flow in an isobaric, reversible process. From equation $(2)$ for such a process it is easily seen that $$𝑑𝐻=TdS=\delta 𝑄_R\tag{5}$$ and this then gives expressions for constant pressure heat capacity: $$C_P=\left(\frac{\partial H}{\partial T}\right)_P=\,\color{red}{T\left(\frac{\partial S}{\partial T}\right)_P}\tag{6}$$
I don't understand how the part marked red in equation $(6)$ was obtained, since heat capacity in general is defined by $$C=\frac{\delta Q}{dT}\tag{7}$$ and from equation $(4)$ $$\delta Q_R=TdS\tag{8}$$ so taking the partial derivative of equation $(8)$ with respect to $T$ means $$\frac{\partial (TdS)}{\partial T}=dS+T\partial (dS)\ne \color{red}{T\left(\frac{\partial S}{\partial T}\right)_P}$$
Could anyone please help me by showing how to obtain the part marked red?