Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to include the header template in a WordPress theme.
Wordpress
<?php [1](); ?> Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using include_header instead of get_header
Trying to include header.php manually with include()
✗ Incorrect
In WordPress, get_header() is used to include the header template file.
2fill in blank
mediumComplete the code to include the footer template in a WordPress theme.
Wordpress
<?php [1](); ?> Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using include_footer instead of get_footer
Trying to load footer manually with include()
✗ Incorrect
The get_footer() function loads the footer template in WordPress themes.
3fill in blank
hardFix the error in the code to include the sidebar template correctly.
Wordpress
<?php [1](); ?> Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using load_sidebar or include_sidebar which are not WordPress functions
Trying to include sidebar manually with include()
✗ Incorrect
The correct function to include the sidebar template in WordPress is get_sidebar().
4fill in blank
hardFill both blanks to create a custom sidebar template named 'custom'.
Wordpress
<?php [1]('[2]'); ?>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using get_footer instead of get_sidebar
Using 'sidebar' instead of 'custom' for the template name
✗ Incorrect
Use get_sidebar('custom') to load sidebar-custom.php template.
5fill in blank
hardFill all three blanks to include header, sidebar, and footer templates in order.
Wordpress
<?php [1](); ?> <?php [2](); ?> <?php [3](); ?>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using load_template which is not a direct template loader
Mixing up the order of header, sidebar, and footer
✗ Incorrect
Use get_header(), get_sidebar(), and get_footer() to include the main template parts in WordPress.