0
0
Wordpressframework~10 mins

Why WordPress powers the web - Test Your Understanding

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

Complete the code to display the site title in a WordPress theme.

Wordpress
<?php bloginfo([1]); ?>
Drag options to blanks, or click blank then click option'
A'admin_email'
B'url'
C'description'
D'name'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'url' instead of 'name' which outputs the site address.
Using 'description' which outputs the tagline, not the title.
2fill in blank
medium

Complete the code to enqueue a stylesheet in WordPress.

Wordpress
wp_enqueue_style([1], get_template_directory_uri() . '/style.css');
Drag options to blanks, or click blank then click option'
A'bootstrap'
B'jquery'
C'main-style'
D'custom-script'
Attempts:
3 left
💡 Hint
Common Mistakes
Using script handles for stylesheets causes confusion.
Not using a unique handle can cause conflicts.
3fill in blank
hard

Fix the error in the WordPress loop to display post titles.

Wordpress
<?php if (have_posts()) : while ([1]) : the_post(); ?>
  <h2><?php the_title(); ?></h2>
<?php endwhile; endif; ?>
Drag options to blanks, or click blank then click option'
Ahave_posts()
Bquery_posts()
Cget_posts()
Dthe_post()
Attempts:
3 left
💡 Hint
Common Mistakes
Using the_post() in the condition causes errors.
Using get_posts() returns an array, not a boolean.
4fill in blank
hard

Fill both blanks to register a custom post type in WordPress.

Wordpress
register_post_type([1], [2]);
Drag options to blanks, or click blank then click option'
A'book'
Barray('label' => 'Books', 'public' => true)
Carray('label' => 'Movies', 'public' => false)
D'movie'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of arguments causes errors.
Using incorrect array keys or values.
5fill in blank
hard

Fill all three blanks to create a shortcode that outputs 'Hello World'.

Wordpress
function [1]() {
  return [2];
}
add_shortcode([3], '[1]');
Drag options to blanks, or click blank then click option'
Ahello_world_shortcode
B'Hello World'
C'hello_world'
D'Hello World!'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the function name as the shortcode tag string incorrectly.
Returning without quotes causes errors.