Bird
0
0

If a custom page template file named 'template-contact.php' contains:

medium📝 component behavior Q5 of 15
Wordpress - Custom Theme Development
If a custom page template file named 'template-contact.php' contains:
<?php
/* Template Name: Contact Page */
get_header();
?>

What will happen when this template is selected for a page?
AThe page will not appear in the template dropdown
BThe page will display with the header and any additional template code
CThe page will cause a fatal error due to missing content
DThe page will show only the header without content
Step-by-Step Solution
Solution:
  1. Step 1: Recognize template header and function

    The template header is correct, and get_header() loads the theme header part.
  2. Step 2: Understand template rendering

    Since the template file runs get_header(), the page will show the header and any other code present.
  3. Final Answer:

    The page will display with the header and any additional template code -> Option B
  4. Quick Check:

    Valid template with get_header() = header shown [OK]
Quick Trick: get_header() loads the header part of the theme [OK]
Common Mistakes:
  • Assuming missing content causes fatal error
  • Thinking template won't appear in dropdown
  • Believing only content is shown without header

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes