Bird
Raised Fist0
Wordpressframework~20 mins

First WordPress site - Practice Problems & Coding Challenges

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
Challenge - 5 Problems
🎖️
WordPress Site Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
What happens when you activate a new WordPress theme?

After installing and activating a new WordPress theme, what is the immediate visible effect on your website?

AThe WordPress dashboard becomes inaccessible until you deactivate the theme.
BAll existing posts and pages are deleted automatically.
CThe website's design and layout change to match the new theme's style.
DThe website's URL changes to a new address.
Attempts:
2 left
💡 Hint

Think about what a theme controls in WordPress.

📝 Syntax
intermediate
2:00remaining
Which WordPress function correctly includes the header template?

In a WordPress theme's template file, which function call correctly includes the header part of the site?

Aget_header();
Binclude_header();
Cload_header();
Dheader_include();
Attempts:
2 left
💡 Hint

WordPress has specific functions for template parts starting with 'get_'.

state_output
advanced
2:00remaining
What is the output of this WordPress loop code snippet?

Consider this WordPress loop snippet inside a theme template:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  <h2><?php the_title(); ?></h2>
<?php endwhile; else : ?>
  <p>No posts found.</p>
<?php endif; ?>

If there are no posts published, what will this code output?

AA PHP error will occur because the_post() is called without posts.
BNothing will be displayed on the page.
C<h2></h2> repeated for each post.
D<p>No posts found.</p>
Attempts:
2 left
💡 Hint

Look at the else part of the if statement.

🔧 Debug
advanced
2:00remaining
Why does this WordPress shortcode not display content?

Given this shortcode function in functions.php:

function my_shortcode() {
  return 'Hello, world!';
}
add_shortcode('greet', 'my_shortcode');

When you add [greet] in a post, nothing appears. What is the likely cause?

AThe theme does not call <code>the_content()</code> to process shortcodes.
BThe shortcode is not registered because add_shortcode is missing a priority argument.
CThe shortcode function must echo, not return, the string.
DShortcodes only work in widgets, not in posts.
Attempts:
2 left
💡 Hint

Shortcodes need to be processed inside the content output.

🧠 Conceptual
expert
3:00remaining
What is the role of the WordPress REST API in modern site development?

Which statement best describes the main purpose of the WordPress REST API?

AIt replaces the WordPress database with a NoSQL system for faster queries.
BIt allows external applications to read and write WordPress content using HTTP requests.
CIt automatically updates WordPress plugins and themes without user input.
DIt converts PHP templates into static HTML files for faster loading.
Attempts:
2 left
💡 Hint

Think about how apps or other websites might interact with WordPress data.

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