Samma Sankappa (right thinking) is the result of right view (Samma Ditthi). If you have the wrong view your thinking will be wrong thinking. (Mittcha Sankappa) Generally, right view is the forerunner for the rest of the Noble Eightfold Path. For example seeing things as impermanent is the right view and seeing things as permanent is the wrong view. With the first, you have the thoughts of renunciation and with the second you have the thought of accumulation.
Of those, right view is the forerunner. And how is right view the forerunner? In one of right view, right thinking comes into being. In one of right thinking, right speech comes into being. In one of right speech, right action... In one of right action, right livelihood... In one of right livelihood, right effort... In one of right effort, right mindfulness... In one of right mindfulness, right concentration... In one of right concentration, right knowledge... In one of right knowledge, right liberation comes into being.