思うように + [verb] 思うようには + [verb ない-form] 思うように + いかない [noun] + が + 思うように + [verb]
思うように means "the way you want", "as you'd hoped". It goes in front of a verb, and the sentence says whether things went along with your wishes. Mostly they didn't: the verb is negative far more often than not, and frequently in the potential.
思う stays in the dictionary form even when the sentence is in the past, as the third example shows.
The commonest phrase is おもうように思うようにいかない, "things don't go the way you want". Adding は – 思うようには – sharpens it: not the way you wanted, whatever else happened.
思うように is about a wish. おもった思ったとおり and おもった思ったように are about a prediction: "just as I thought", whether you wanted it or not.
By default the wish is the subject's or the speaker's. To make it someone else's, put that person in front with が.