0
0
Wordpressframework~10 mins

Header and footer customization in Wordpress - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Header and footer customization
Start WordPress Theme
Locate header.php & footer.php
Edit header.php
Add/Change HTML & PHP for header
Save header.php
Edit footer.php
Add/Change HTML & PHP for footer
Save footer.php
Refresh Website
See updated header & footer
End
This flow shows how WordPress loads header and footer files, how you edit them, save changes, and see updates on the website.
Execution Sample
Wordpress
<?php
// header.php snippet
?><header>
  <h1>My Site Title</h1>
</header>

<?php
// footer.php snippet
?><footer>
  <p>© 2024 My Site</p>
</footer>
This code adds a simple header with a site title and a footer with copyright text.
Execution Table
StepFile EditedActionCode ChangeEffect on Site
1header.phpOpen fileLocate header.php in theme folderReady to edit header
2header.phpAdd HTML<header><h1>My Site Title</h1></header>No visible change yet
3header.phpSave fileSave changesHeader updates on refresh
4footer.phpOpen fileLocate footer.php in theme folderReady to edit footer
5footer.phpAdd HTML<footer><p>© 2024 My Site</p></footer>No visible change yet
6footer.phpSave fileSave changesFooter updates on refresh
7BrowserRefresh pageReload websiteSee new header and footer
8EndNo more editsCustomization completeSite header and footer customized
💡 Customization stops after saving and refreshing to see changes.
Variable Tracker
VariableStartAfter header editAfter footer editFinal
header.php contentOriginal header code<header><h1>My Site Title</h1></header><header><h1>My Site Title</h1></header><header><h1>My Site Title</h1></header>
footer.php contentOriginal footer codeOriginal footer code<footer><p>© 2024 My Site</p></footer><footer><p>© 2024 My Site</p></footer>
Website displayOld header and footerHeader updated, footer oldHeader updated, footer updatedHeader and footer updated
Key Moments - 3 Insights
Why do changes in header.php not show up immediately after editing?
Because you must save the file and refresh the browser to see the updated header, as shown in steps 3 and 7 in the execution table.
Can I customize header and footer without touching PHP code?
Some themes offer settings in the WordPress dashboard, but direct customization usually requires editing header.php and footer.php files, as shown in the flow.
What happens if I delete header.php or footer.php?
The site may lose its header or footer display or show errors, so always back up files before editing.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the effect on the site after step 2?
ANo visible change yet
BFooter shows copyright text
CHeader shows site title
DSite refreshes automatically
💡 Hint
Check the 'Effect on Site' column for step 2 in the execution table.
At which step do you see both header and footer updated on the website?
AStep 5
BStep 7
CStep 6
DStep 3
💡 Hint
Look for the step where the browser refreshes and shows both changes.
If you forget to save footer.php after editing, what will happen?
AFooter updates on refresh
BHeader disappears
CFooter remains unchanged
DSite crashes
💡 Hint
Refer to the importance of saving files before refreshing in the execution table steps 5 and 6.
Concept Snapshot
Header and footer customization in WordPress:
- Edit header.php and footer.php files in your theme folder.
- Add or change HTML/PHP code for header/footer content.
- Save files and refresh your website to see changes.
- Always back up files before editing.
- Changes appear only after saving and refreshing.
Full Transcript
In WordPress, the header and footer are controlled by separate files named header.php and footer.php inside your theme folder. To customize them, you open these files and add or change the HTML and PHP code that defines what appears at the top and bottom of your site. After editing, you save the files and refresh your website in the browser to see the changes. This process is shown step-by-step in the execution table, starting from opening the files, editing, saving, and finally refreshing the page to view the updated header and footer. Remember, changes won't appear until you save and refresh. Also, be careful to back up your files before making edits to avoid losing important code. This method lets you personalize your site's look by controlling the header and footer content directly.