For Case 1: Building from scratch
- First you need to create the
Theme Stylesheetcalledstyle.cssfor registering the theme. - Then create the
index.phpfile form your rawHTMLindex file. - After that break down the
index.phpintoheader.php,index.phpandfoter.phpto create the primary scaffolding for your theme. -
Then create
functions.phparchive.phppage.phpsingle.phpsearch.phpcomments.phpfront-page.phphome.phpdate.phpauthor.phpcategory.phptag.phpattachment.phpimage.php404.phprtl.css
-
Now create a directory called
assetsand create two more folder calledjsandcss. Put your themesCSSandJavaScriptfiles on those directories - After that enqueue those files in
functions.phpwithwp_enqueue_style()andwp_enqueue_script()function. - And your full scaffolding is done here. Now you’re ready to write your loops and related
HTMLto your theme. From here after you follow standard procedure according to WordPress convention to write your theme.
For Case 2: Using starter theme such as _s
For any starter theme all the scaffolding is already done. So you can start putting you CSS and JavaScript codes in the *.css and *.js files given with the starter theme and you can manipulate the loops as well as other codes comes with the starter theme. If we break down the process it would be like-
- Install the starter theme.
- Put your
CSScodes in the*.cssfile and*.jsfile. - Start manipulating the theme files for getting your design and functionality.
For both case it would be great if you import the Theme Unit Test data provided by WordPress.