0
0
Wordpressframework~10 mins

First WordPress site - Interactive Code Practice

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

Complete the code to set the site title in the WordPress theme header.

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

Complete the code to include the WordPress header template in your theme.

Wordpress
<?php [1]('header'); ?>
Drag options to blanks, or click blank then click option'
Aget_header
Bget_footer
Cwp_head
Dload_template
Attempts:
3 left
💡 Hint
Common Mistakes
Using get_footer() loads the footer, not the header.
Using wp_head() is a hook, not a template loader.
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'
Aquery_posts
Bget_post
Chave_posts
Dthe_post
Attempts:
3 left
💡 Hint
Common Mistakes
Using the_post() in the loop condition causes errors.
Using get_post() does not check for posts in the loop.
4fill in blank
hard

Fill both blanks to create a WordPress menu location and display it.

Wordpress
<?php register_nav_menus(array('[1]' => '[2]')); ?>
<?php wp_nav_menu(array('theme_location' => '[1]')); ?>
Drag options to blanks, or click blank then click option'
Aprimary
Bfooter
CMain Menu
DFooter Menu
Attempts:
3 left
💡 Hint
Common Mistakes
Using different slugs in register and display causes the menu not to show.
Mixing description and slug values in the wrong places.
5fill in blank
hard

Fill all three blanks to enqueue a stylesheet properly in WordPress.

Wordpress
<?php function theme_styles() {
  wp_enqueue_style('[1]', get_template_directory_uri() . '/[2]', array(), '[3]');
}
add_action('wp_enqueue_scripts', 'theme_styles');
Drag options to blanks, or click blank then click option'
Amain-style
Bstyle.css
C1.0
Dtheme-style
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong handle name causes conflicts.
Incorrect file path prevents the stylesheet from loading.
Omitting version can cause caching issues.