To substitute for vegetable oil, use the amount of oil called for in the recipe, melt the coconut oil and be sure that the other ingredients (eggs, liquids, etc.) are at room temperature or at least warm enough so that they do not cool the coconut oil enough to make it solidify.
To substitute for shortening, use a combination 1/2 butter and 1/2 coconut oil. (Actually the amount of coconut oil can be reduced by about 25%, so in a recipe calling for 1 cup of shortening I would use 1/2 cup butter and 3/8 cup of coconut oil. If you want to use all coconut oil 3/4 cup of coconut oil should work as a substitute for 1 cup of shortening.)
SUGGESTION FOR MEASURING SOLID COCONUT OIL
When coconut oil is cooled much below 76°F (the temperature at which it solidifies) it not only becomes solid but actually rather hard. Oil which has been refrigerated is quite hard and rather brittle. After the coconut oil hardens the easiest way I have found to scoop it out is to take a tablespoon (not a measuring spoon, but a large soup type spoon) and scrape it repeatedly across the surface. As the oil is scraped off it takes on a paste like consistency which makes it easy to measure or to cream together with butter.