I agree with Steve in regards to using treated posts. If you want to use wood this is the best and most durable choice. If you want to stain them you can but wait awhile for the sap to leach out of the wood. Use a stain that has UV protection for the best results. Check with your local building inspector to determine the depth the posts need to be. Depending upon the area, of the country, in which you live the frost depth varies. Check with the local building authorities to determine this depth.