readyforhires

Intermediate WordPress test (Intermediate)

30 questions · 35 minutes · Free

Theme development, custom post types, hooks and WooCommerce.

Take the Intermediate WordPress test

What it covers

Interview format

Earn a certificate

The Intermediate WordPress test is one of the 6 tests of the WordPress Developer learning path. Pass it and the other 5 tests at 70% or more and readyforhires issues you a verifiable certificate in your name, with its own code and verify link to share or add to LinkedIn.

Sample learning path certificate for WordPress Developer, made out to “Your name” and marked SAMPLE
Pass with 70% or more to earn a verifiable certificate. This is a sample: yours carries your name, the date you earned it and its own verify code.

Sample questions

5 sample questions from the Intermediate WordPress test, with the answers. Samples are taken out of the live test, so you will not meet these when you sit it.

  1. Which template file takes precedence when viewing a single post of a custom post type with the slug 'book-review'?

    1. single-{post_type}-{slug}.php
    2. single.php
    3. single-{post_type}.php
    4. index.php

    Answer: A. single-{post_type}-{slug}.php

    When a single post of a specific post type and slug is viewed, WordPress prioritizes the most specific template file, which is single-{post_type}-{slug}.php. If this file does not exist, it falls back to single-{post_type}.php, then single.php, and so on.

  2. Which method is the correct and recommended way to customise WooCommerce email templates?

    1. Use the 'woocommerce_email' hook and override the template in your theme's woocommerce/emails/ directory.
    2. Use the 'woocommerce_email_template' filter and edit the template in the plugin's original location.
    3. Modify the core WooCommerce plugin files directly for email templates.
    4. Use the 'woocommerce_before_email' hook and copy the template to your theme's root directory.

    Answer: A. Use the 'woocommerce_email' hook and override the template in your theme's woocommerce/emails/ directory.

    To customise WooCommerce email templates, you should use the 'woocommerce_email' hook and override the template in your theme's woocommerce/emails/ directory. This approach ensures performance and avoids modifying core files, which is not recommended. The other options either suggest incorrect hooks or methods that do not align with WooCommerce's template override system.

  3. A developer registered a custom post type with a custom rewrite slug, but the URLs for the post type are not working and result in 404 errors. What is the correct solution to resolve this issue?

    1. Flush the rewrite rules once by visiting the Permalinks settings or using flush_rewrite_rules() on plugin activation.
    2. Call flush_rewrite_rules() on every request to ensure the rewrite rules are always up to date.
    3. Register the custom post type on the 'init' hook without any additional steps.
    4. Ignore the rewrite rules since they are automatically handled by WordPress.

    Answer: A. Flush the rewrite rules once by visiting the Permalinks settings or using flush_rewrite_rules() on plugin activation.

    When a custom post type is registered with a custom rewrite slug, the rewrite rules must be flushed once to ensure WordPress recognizes the new URLs. This can be done by visiting the Permalinks settings page or using flush_rewrite_rules() during plugin activation. Calling flush_rewrite_rules() on every request is inefficient and should be avoided. Registering a custom post type on the 'init' hook is correct, but it does not automatically flush rewrite rules.

  4. A WordPress page has the slug 'about'. Which template file will be used first by WordPress to render the page?

    1. page.php
    2. page-about-us.php
    3. page-about.php
    4. singular.php

    Answer: C. page-about.php

    WordPress looks for the most specific template that matches the page slug. If a page has the slug 'about', WordPress will look for page-about.php first. If that file does not exist, it will fall back to page.php, then singular.php, and finally index.php.

  5. Which of the following is the correct approach to override the template for a specific post type using a filter?

    1. Use the 'single_template' filter to override the template for a specific post type.
    2. Use the 'template_include' filter to override the template for a specific post type.
    3. Use the 'archive_template' filter to override the template for a specific post type.
    4. Use the 'page_template' filter to override the template for a specific post type.

    Answer: B. Use the 'template_include' filter to override the template for a specific post type.

    The 'template_include' filter allows you to override the template for a specific post type by returning the path to a custom template file. This is a recommended approach for modifying template parts with filters in a realistic project scenario. Other options are incorrect because they either describe incorrect filters or do not directly address the task of modifying template parts with filters.

Frequently asked questions

How many questions are in the Intermediate WordPress test?
30 questions (18 multiple choice, 9 multi-answer, 3 predict-the-output), with 35 minutes to answer them.
What does the Intermediate WordPress test cover?
WordPress theme development, WordPress custom post types, WordPress actions and filters, WooCommerce, WordPress template hierarchy.
Is the Intermediate WordPress test free?
Yes. It is free to take with a readyforhires account.
What level is the Intermediate WordPress test?
Intermediate, in Frontend.

More Frontend tests

Roles that test these skills

Companies that test these skills

All practice tests · All Frontend tests

Last updated