Bird
Raised Fist0
Wordpressframework~10 mins

First WordPress site - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
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.

Practice

(1/5)
1. What is the main purpose of WordPress when creating a website?
easy
A. To create databases manually
B. To write complex programs for web servers
C. To build websites easily without needing to write code
D. To design mobile apps only

Solution

  1. Step 1: Understand WordPress's role

    WordPress is a tool designed to help users create websites without coding.
  2. Step 2: Compare options

    Options A, B, and C describe tasks unrelated to WordPress's main purpose.
  3. Final Answer:

    To build websites easily without needing to write code -> Option C
  4. Quick Check:

    WordPress = Easy website building [OK]
Hint: WordPress is for websites, not coding apps [OK]
Common Mistakes:
  • Thinking WordPress is for app development
  • Confusing WordPress with programming languages
  • Assuming WordPress manages databases manually
2. Which of the following is the correct way to add a new page in WordPress?
easy
A. Go to Dashboard > Pages > Add New
B. Go to Dashboard > Plugins > Add New
C. Go to Dashboard > Appearance > Themes
D. Go to Dashboard > Settings > General

Solution

  1. Step 1: Locate where pages are managed

    Pages are added via the Pages menu in the WordPress Dashboard.
  2. Step 2: Identify the correct menu path

    Go to Dashboard > Pages > Add New correctly shows Dashboard > Pages > Add New, which is how to add a page.
  3. Final Answer:

    Go to Dashboard > Pages > Add New -> Option A
  4. Quick Check:

    Pages added under Pages menu [OK]
Hint: Pages are under 'Pages' menu, not Plugins or Settings [OK]
Common Mistakes:
  • Trying to add pages under Plugins
  • Confusing Themes with Pages
  • Looking in Settings for page creation
3. If you activate a new theme in WordPress, what will happen to your website's appearance?
medium
A. The website's URL will change
B. The website content will be deleted
C. The website will stop working until you add new content
D. The website's look and style will change according to the new theme

Solution

  1. Step 1: Understand what a theme controls

    A WordPress theme controls the design and layout of the website.
  2. Step 2: Effects of activating a new theme

    Activating a new theme changes the website's appearance but does not delete content or change URL.
  3. Final Answer:

    The website's look and style will change according to the new theme -> Option D
  4. Quick Check:

    Theme changes appearance only [OK]
Hint: Themes change look, not content or URL [OK]
Common Mistakes:
  • Thinking content is deleted when changing themes
  • Believing website stops working after theme change
  • Assuming URL changes with theme activation
4. You tried to add a new post but the 'Add New' button is missing under Posts. What is the likely cause?
medium
A. You need to install a plugin to add posts
B. You are not logged in or lack permission to add posts
C. Your website theme does not support posts
D. Your WordPress installation is corrupted

Solution

  1. Step 1: Check user permissions

    Only logged-in users with proper roles can add posts; missing button often means no permission.
  2. Step 2: Rule out other causes

    Themes do not remove post functionality; plugins are not required to add posts; corruption is less common.
  3. Final Answer:

    You are not logged in or lack permission to add posts -> Option B
  4. Quick Check:

    Missing button = permission issue [OK]
Hint: Check login and user role first if buttons missing [OK]
Common Mistakes:
  • Blaming theme for missing post button
  • Assuming plugin needed to add posts
  • Jumping to corruption without checking permissions
5. You want to create a homepage that shows your latest blog posts and also a separate About page. Which steps should you follow in WordPress?
hard
A. Set homepage to display latest posts in Settings > Reading, then create a new About page under Pages
B. Create a new post called About and set it as homepage
C. Install a plugin to create pages and posts
D. Change the theme to one that only shows posts on homepage

Solution

  1. Step 1: Configure homepage to show latest posts

    In Settings > Reading, set 'Your homepage displays' to 'Your latest posts' to show blog posts on homepage.
  2. Step 2: Create About page separately

    Create a new page named About under Pages to have a separate About page.
  3. Final Answer:

    Set homepage to display latest posts in Settings > Reading, then create a new About page under Pages -> Option A
  4. Quick Check:

    Homepage posts + About page = Set homepage to display latest posts in Settings > Reading, then create a new About page under Pages [OK]
Hint: Use Settings > Reading for homepage, Pages for About [OK]
Common Mistakes:
  • Using a post as About page
  • Thinking plugins are needed for basic pages
  • Changing theme unnecessarily