0
0
Wordpressframework~10 mins

Why themes control presentation in Wordpress - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to include the theme's header in a WordPress template.

Wordpress
<?php [1]('header'); ?>
Drag options to blanks, or click blank then click option'
Aheader_include
Binclude_header
Cload_header
Dget_header
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent functions like include_header()
Trying to manually include header files without WordPress functions
2fill in blank
medium

Complete the code to display the site title using the theme's function.

Wordpress
<h1>[1]();</h1>
Drag options to blanks, or click blank then click option'
Aget_title
Bsite_title
Cbloginfo
Dthe_title
Attempts:
3 left
💡 Hint
Common Mistakes
Using the_title() which is for posts, not site title
Using non-existent functions like get_title()
3fill in blank
hard

Fix the error in the code to properly enqueue a theme stylesheet.

Wordpress
<?php wp_enqueue_style([1], get_template_directory_uri() . '/style.css'); ?>
Drag options to blanks, or click blank then click option'
A'theme-style'
Btheme-style
C'style.css'
Dstyle
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around the handle string
Using the filename as the handle without quotes
4fill in blank
hard

Fill both blanks to register and enqueue a theme script properly.

Wordpress
<?php wp_register_script([1], get_template_directory_uri() . '/js/script.js', array('jquery'), null, true); wp_enqueue_script([2]); ?>
Drag options to blanks, or click blank then click option'
A'theme-script'
B'jquery'
C'script.js'
D'theme-style'
Attempts:
3 left
💡 Hint
Common Mistakes
Using different handles in register and enqueue
Using incorrect handle names like 'jquery' or 'theme-style'
5fill in blank
hard

Fill all three blanks to create a custom page template header in a theme file.

Wordpress
<?php
/*
Template Name: [1]
Description: [2]
*/
get_header([3]);
?>
Drag options to blanks, or click blank then click option'
A'Custom Page'
B'A special page template for custom layout'
Cnull
D'custom'
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting the template name or description
Using null instead of the custom header name
Omitting the custom header argument