Bird
0
0

How can you create a custom header that includes a dynamic site tagline and is used only on the homepage?

hard📝 Application Q9 of 15
Wordpress - Custom Theme Development
How can you create a custom header that includes a dynamic site tagline and is used only on the homepage?
AModify functions.php to override get_header() globally
BAdd the tagline directly in header.php without conditions
CUse wp_footer hook to add the tagline on homepage
DCreate header-home.php with code to display the tagline and call get_header('home') on homepage template
Step-by-Step Solution
Solution:
  1. Step 1: Create a custom header template for homepage

    Make a file named header-home.php with code to display the dynamic site tagline.
  2. Step 2: Load this header only on homepage

    In the homepage template, call get_header('home') to load the custom header.
  3. Final Answer:

    Create header-home.php with code to display the tagline and call get_header('home') on homepage template -> Option D
  4. Quick Check:

    Custom header + get_header('home') for homepage only [OK]
Quick Trick: Use get_header('name') to load custom headers per template [OK]
Common Mistakes:
  • Adding tagline unconditionally in header.php
  • Using wp_footer hook for header content
  • Trying to override get_header() function globally

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes