The standard turbulent law of the wall, devised for zero pressure gradient flows, has been previously shown to be inadequate for accelerating and decelerating turbulent boundary layers. In this paper, formulations for mean velocity profiles from the literature are applied and formulations for the temperature profiles are developed using a mixing length model. These formulations capture the effects of pressure gradients by including the convective and pressure gradient terms in the momentum and energy equations. The profiles which include these terms deviate considerably from the standard law of the wall; the temperature profiles more so than the velocity profiles. The new profiles agree well with experimental data. By looking at the various terms separately, it is shown why the velocity law of the wall is more robust to streamwise pressure gradients than is the thermal law of the wall. The modification to the velocity profile is useful for evaluation of more accurate skin friction coefficients from experimental data by the near-wall fitting technique. The temperature profile modification improves the accuracy with which one may extract turbulent Prandtl numbers from near-wall mean temperature data when they cannot be determined directly.