↓記事が古いので、少しテンプレートタグが違うところもあるかもしれませんが、考え方は勉強になります。
http://kachibito.net/wordpress/theme-development-flow.html