0
0
Wordpressframework~10 mins

Why understanding theme files matters 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 main stylesheet in a WordPress theme.

Wordpress
wp_enqueue_style('theme-style', get_template_directory_uri() . '/[1]');
Drag options to blanks, or click blank then click option'
Aheader.php
Bindex.php
Cfunctions.php
Dstyle.css
Attempts:
3 left
💡 Hint
Common Mistakes
Using a PHP file instead of a CSS file.
Forgetting the file extension.
Confusing template files with stylesheets.
2fill in blank
medium

Complete the code to load the header template part in a WordPress theme.

Wordpress
get_[1]('header');
Drag options to blanks, or click blank then click option'
Apart
Btemplate
Ctemplate_part
Dheader
Attempts:
3 left
💡 Hint
Common Mistakes
Using get_header() instead, which does not take parameters.
Using incorrect function names.
Confusing template parts with stylesheets.
3fill in blank
hard

Fix the error in the code to properly register a navigation menu in WordPress.

Wordpress
register_nav_menu('[1]', 'Primary Menu');
Drag options to blanks, or click blank then click option'
Aprimary_menu
Bprimary-menu
CprimaryMenu
Dprimary menu
Attempts:
3 left
💡 Hint
Common Mistakes
Using spaces in the slug name.
Using underscores instead of hyphens.
Using camelCase which is not standard.
4fill in blank
hard

Fill both blanks to create a child theme style enqueue that loads the parent style first.

Wordpress
wp_enqueue_style('child-style', get_stylesheet_uri(), array([1]), wp_get_theme()->get('Version'));
Drag options to blanks, or click blank then click option'
A'parent-style'
B'child-style'
C'main-style'
D'theme-style'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the child style handle as a dependency.
Using a wrong or non-existent handle.
Leaving the dependency array empty.
5fill in blank
hard

Fill all three blanks to register and display a sidebar in a WordPress theme.

Wordpress
register_sidebar(array('name' => '[1]', 'id' => '[2]', 'before_widget' => '[3]'));
Drag options to blanks, or click blank then click option'
AMain Sidebar
Bmain-sidebar
C<div class='widget'>
Dsidebar-main
Attempts:
3 left
💡 Hint
Common Mistakes
Using spaces in the id.
Not wrapping widgets in HTML.
Confusing name and id values.