How to Use the Twenty Fifteen WordPress Main Index Template

By Lisa Sabin-Wilson

The Twenty Fifteen WordPress Main Index template drags your blog posts out of the MySQL database and inserts them into your site. This template is to your blog what the dance floor is to a nightclub — where all the action happens.

The filename of the Main Index template is index.php. In the default Twenty Fifteen theme, you can find it in the /wp-content/themes/twentyfifteen/ folder.

The first template tag in the Main Index template calls in the Header template, meaning that it pulls the information from the Header template into the Main Index template, as follows:

<?php get_header(); ?>

Your theme can work without calling in the Header template, but it’ll be missing several essential pieces — the CSS and the blog name and tagline, for starters. Without the call to the Header template, your blog resembles this image.

A WordPress blog missing the call to the header. It’s naked!

A WordPress blog missing the call to the header. It’s naked!

The Main Index template in the default theme, Twenty Fifteen, calls in two other files in a similar fashion:

  • get_template_part( content, get_post_format );: This function calls in the template file named content.php as well as prepares the theme to accept special templates for a feature called Post Formats.

  • get_footer();: This function calls in the template file named footer.php.

The Main Index template calls the four functions for the Header, Loop, Sidebar, and Footer templates.