Approx Time: 3.5 Minutes
If you haven’t already, check out the previous post on generating the WordPress theme in Pinegrow. This video series will form a complete guide on creating a WordPress theme in Pinegrow. Download the source files for the project here.
WordPress Theme Structure – Creating the WordPress Header & Footer PHP Files in Pinegrow
The page we added the WordPress site action to is our master page. This will control the header and footer of our theme.
A WordPress theme should have a separate Header and Footer file that contains the code that is the same across the rest of the pages of the theme. Such as navigation menus and footer areas.
These are header dot php and footer dot php.
Header.php typically consists of the theme styles and some scripts, which are added via php from the function dot PHP file. This is added to pages using the PHP function get header. A navigation menu is usually included also, sometimes called via a template part. More on that later in the tutorial.
Let’s create this structure in Pinegrow.
Our page should be divided into 3 main sections. Header, Main and Footer.
Everything above the Main HTML tag will be the theme header and everything below it will go into footer.php.
Everything else inside the main.html tag will be index.php
Click on main.
Assign the site content action to the main element.
This will automatically generate Header and footer PHP files.
Save and export the theme.
When the theme exports, header.php and footer.php should now be located in your themes folder.