Now begins the task of looking at the php files that you will find in the theme. I want to look at them all, detailing what they do in each case. I will need to study the documentation at wordpress.org to do this and then I will document my finding for each php file. I want to understand what is being done in each php file and why it is being done that way.
First, the index.php file.
This is the main template file and is one of the required files in a theme (the other being style.css). It is used to display a page when nothing more specific matches a query, e.g. it puts together the home page when no home.php file exists. Learn more: http://codex.wordpress.org/Template_Hierarchy.
The index.php file calls and displays the header, then it executes the wordpress loop by calling for the loop.php file, then calls for and displays the sidebar and footer.
To run the loop, loop.php uses the php function ‘get_template_part’ with parameters, loop and index. It will look for a ‘loop-index.php’ file and execute it if found, if not found, it will look for and execute ‘loop.php’. There is no ‘loop-index.php’ file in Starkers, but there is a ‘loop.php’ file, so wordpress goes to the ‘loop.php’ file, executes it, and returns to ‘index.php’. Already done before executing the wordpress loop was the header function, now the sidebar and footers are displayed, by a call to ‘get_sidebar’ and ‘get_footer’ respectively.
The next file we will look at is that ‘loop.php’ file.